News for hackers. Stuff that matters.
Re:An Open Letter to the Go Team About Try by qtplatypus on Wednesday July 03, 2019 @04:47PM (#20348616)
All “try” does is allow you to write those three lines as five characters. In natural languages the more frequent used a word is the shorter that word tends to be. “Check for errors and return” is something that is frequently said in go, following from those principles it should be something that it short to write.
Re:An Open Letter to the Go Team About Try by marcus_holmes on Thursday July 04, 2019 @09:44AM (#20354553)
I see that, but it breaks the rhythm, and introduces an alternative syntax that makes it harder, not easier, to read. And code should be easier to read than to write, because we're going to read it way more than we write it.

Instead of "do something, check for errors, do something, check for errors" we would have "do something, check for errors, try something, do something, check for errors" (assuming not all errors are going to be "try"d, and some will need to be wrapped).

It stops being obvious when I've missed an error-check. That's bad.

Re:An Open Letter to the Go Team About Try by qtplatypus on Friday July 05, 2019 @01:59AM (#20360172)
How can you miss an error check?

Either you have used try and therefor there has been a check for errors.

Or you have not used try and therefor you had to assign to err and therefor you have to use a check for errors.

Any assignment to err indicates you need to check for errors just like it is currently.