3 ms·
C++'s throw lets you postpone handling of erroneous condition. You throw, then sort. You can postpone sorting of causes indefinitely, basically, up to the level
by thesz 4y ago
C++'s throw lets you postpone handling of erroneous condition. You throw, then sort. You can postpone sorting of causes indefinitely, basically, up to the level where all of context needed is lost.
In C, you cannot throw. You have to handle. There will be more "if" statements, that's price to pay.
I work on code in C and C++ in more or less close problem domains and C++ provokes style and/or design that is much more hard to work with.
One of culprits is deep inheritance - once built, the inheritance structure cannot be changed. And I saw inheritance trees as deep as 10 recently. Instead of refactoring, I see copy-paste.