|
|
|
|
|
by je42
2364 days ago
|
|
also note that Java has checked exceptions, and a lot of programmers still opt to deal with errors in a lazy way. Same for error codes, go has explicit error, and several programmers still opt to deal with errors in a lazy way. I think the syntax and semantical contructs a language offers doesnt matter much when a lot of programmers dont have time and/or discipline and/or priority to deal with error cases. Error handling is hard. Also, since programmers in general think less about errors, library often dont expose errors in helpful ways and/or well-defined ways. |
|
That's one reason I like Go's approach, even if the boilerplate is ugly. When writing Go code, I'm pushed to think about the `err` returned value. When reading Go code, I know directly how `err` is handled, without any surprise, and if it isn't then that should be for a reason, so something to dig out. While it's quite annoying at first, after some time it becomes quite easy to either mentally filter out the error handling boilerplate (thus focus on the actual logic), or focus on it.
Of course, YMMV.