4 ms·
In actual code things would not be named as they were above and it would be shorter, I was just trying to make it look reasonably like the C for HN.
by voidlogic 13y ago
In actual code things would not be named as they were above and it would be shorter, I was just trying to make it look reasonably like the C for HN.
- acdha 13y agoTrue, but I've definitely noticed that particular style of writing if tests using a one-line assignment and obscured test condition seems to be pretty common in the Go community and it's a bad habit for understanding code.
- voidlogic 13y ago>>it's a bad habit for understanding code. Is there objective evidence for this? As a Go programmer a semicolon in an if statement screams to me. I can see it possibly being in issue for new Go programmers- but I don't remember it being one for me.
- acdha 13y agoI didn't do a survey but I remember that and frequently punting on error handling (`res, _ = something_which_could_error()`) showing up enough in the projects I saw on Github to stand out as a trend when I was writing a few first programs. I certainly hope that's just sampling error.