| ▲ | dzonga a day ago | ||||||||||||||||||||||
I guess a bigger conversation could be had in regards to: what leads to better code in terms of understandability & preventing errors Exceptions (what almost every language does) or Error codes (like Golang) are there folks here that choose to use error codes and forgo Exceptions completely ? | |||||||||||||||||||||||
| ▲ | jandrewrogers a day ago | parent [-] | ||||||||||||||||||||||
There isn't much of a conversation to be had here. For low-level systems code, exceptions introduce a bunch of issues and ugly edge cases. Error codes are cleaner, faster, and easier to reason about in this context. Pretty much all systems languages use error codes. In C++, which supports both, exceptions are commonly disabled at compile-time for systems code. This is pretty idiomatic, I've never worked on a C++ code base that used exceptions. On the other hand, high-level non-systems C++ code may use exceptions. | |||||||||||||||||||||||
| |||||||||||||||||||||||