Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>The problem with error code return is tediousness

Tediousness is only relevant at the time of writing the code, which is the least important part of programming. You read code 100x times as often as you write it, writeability is simply the wrong aspect to optimize for.

>How do people using Go and other languages that don't have exceptions solve this reduced readability problem?

Readability isn't reduced, it's enhanced - the control flow is explicit, there's no magic in the form of implicit returns.



> Tediousness is only relevant at the time of writing the code, which is the least important part of programming. You read code 100x times as often as you write it, writeability is simply the wrong aspect to optimize for.

I'm kind of tired of this argument, as if the writability of a language doesn't matter at all. Over a long enough time frame, with a large enough team, etc, this is absolutely true, but when you're writing features _now_ that need to be released ASAP so the company can make money, the speed at which you write code is one of the most important factors to your productivity. Language ergonomics matter tremendously for this, affecting the time it takes to write, the chance for mistakes, and the amount of frustration you feel.


Error checking should also really be enforced by the language. It's too easy to forget otherwise.


Thank you for saying this. It seems like not many PL enthusiasts get this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: