News for hackers. Stuff that matters.
Re:Go 1.18 by Mawr on Tuesday March 15, 2022 @05:42PM (#30692170)
I agree that the latter version is too verbose, but if the alternative is this:

  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.
Re:Go 1.18 by collaborative on Tuesday March 15, 2022 @07:26PM (#30693303)
I love stuffing things into one-liners. Not hard to see what is happening if you understand it enough

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