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

But this would be very good advice! Exceptions (a.k.a. modern-flavored COMEFROM statements[0]) are extremely confusing and have no place in a clean codebase.

[0] https://en.wikipedia.org/wiki/COMEFROM



Exceptions do not specify from where exactly they should “come from” and are two-way protocol akin to setjmp/longjmp. Situations where exit through few levels of stack is required do happen regardless of code cleanness, and the only alternative is to pair every call with a flow control statement, turn primary return value into a status, and add two out-arguments for error and result. Some people love this, some not really.


Exceptions are the worst, except for any other way of handling errors.


I agree, but your sentence is empty: errors do not exist, they are just conditions that you dislike. Do not let your emotions affect the syntax for control flow!


Great, I will tell that to my customers!




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

Search: