by Mawr · 4y ago · 0 comments
err := h(cond(x) ? f(x) : g(x))
... then I'd much rather stick with the verbosity. There's way too much going on in a single line here.I'd rather have if statements be expressions, with gofmt-enforced line breaks:
err := h(
if cond(x) {
f(x)
} else {
g(x)
},
)
No unnecessary temp variables and no stuffing everything into one line.Reason is I prefer to move my eye balls than scroll the screen. Too many lines and you forget what preceded what you're seeing or have to keep scrolling to make sense of everything