3 ms·
If it matters to anyone, this novice finds “if” easier to understand than “try”. Very refreshing for novice to agree on expert on a topic.
by pbreit 7y ago
If it matters to anyone, this novice finds “if” easier to understand than “try”.
Very refreshing for novice to agree on expert on a topic.
- tdb7893 7y agoI don't think many people think that "if" is hard to understand. My problem with the "if" statements is that a third to half of the lines in a couple of my codebase are roughly the same copy pasted error handling (the codebases use the os package, which has pretty much every function return errors) and having all of that same boilerplate just clutters the code and makes it harder to read. It would be a real readability win to have less boilerplate in Go.
- Someone 7y agoHad anybody ever thought about using ‘go generate’ to insert missing ‘if err… return’ clauses with descriptive error messages? If so, where’s (s)he buried? :-)