4 ms·
> it's not hard to scan through a program line-by-line asking yourself "what would happen if an exception were thrown at this point?" I once implemented a C++
by grogers 8y ago
> it's not hard to scan through a program line-by-line asking yourself "what would happen if an exception were thrown at this point?"
I once implemented a C++ class where some member functions implemented the strong exception safety guarantee. I can tell you, yes it really is that hard. Even when you know certain variables are pointers and can't throw, you are tiptoeing around on razorblades.
At my day job we use exceptions in Java a lot, and it's a good abstraction for rolling back database transactions. But for non-transactional code it isn't the best.