top | item 33657022

(no title)

BrainVirus | 3 years ago

>Concise Go code has a high signal-to-noise ratio.

A few lines later:

  // Good:
  if err := doSomething(); err != nil {
      // ...
  }
"Tell me, how many lights you see?"

discuss

order

B-Con|3 years ago

I think that it is fair to say Go considers error handling to be signal, not noise.

This position has obviously prompted a philosophical war and not everyone agrees, but the two statements are consistent under Go's philosophy.

Ferret7446|3 years ago

What's wrong with this? The code is doing... exactly what it says. Call doSomething and if it returns an error do something else. What part of that is noise?

michaelcampbell|3 years ago

As does most code. That doesn't mean it has a high signal:noise ratio.