What are the downsides of error codes?
A major drawback of error codes is that they lead to function calls being intertwined with if..else blocks testing for the various error conditions. The result is that program logic is mixed up with error handling. This is not a big issue in the simple example above, but it quickly becomes confusing in real-world code. Should I use error codes? …