|
|
|
|
|
by aavz
3690 days ago
|
|
Exceptions have the same problem as return codes in that you need to be careful to leave things in a consistent state if a function throws an error. RAII can help to some extent in both cases, but doesn't magically enforce that your classes and data structures are internally consistent. My experience has been that error paths have a way of getting things into inconsistent states, and then you're in trouble regardless. Checking return codes is annoying but if you're wanting to write robust software, your code needs to be in some way aware of every possible error path. |
|