5 ms·
>Concise Go code has a high signal-to-noise ratio. A few lines later: // Good: if err := doSomething(); err != nil { // ... } "Tell me, how many
by BrainVirus 4y 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?"
- B-Con 4y agoI 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 4y agoWhat'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 4y agoAs does most code. That doesn't mean it has a high signal:noise ratio.
- robertlagrant 4y agoSome of these threads seem like that party game where people write a story together, but each player can only read the previous sentence of the story when writing the next one.