3 ms·
Go is great, but I wish they would add terany operator support.
by fuddle 11y ago
Go is great, but I wish they would add terany operator support.
- oofabz 11y agoThey won't. The Go authors value simplicity. Many people dislike ternary syntax and find it hard to read. Go errs on the side of verbosity and readability. It is sort of the opposite of Perl in that respect.
- fuddle 11y agoWhich is more simple, an if/else block or a terany operator? if/else: if i == 0 { return "foo" } else { return "bar" } terany: return i == 0 ? "foo" : "bar"