Feb-25-2024, 10:53 AM
(This post was last modified: Feb-25-2024, 10:54 AM by Gribouillis.)
(Feb-25-2024, 10:12 AM)SirDonkey Wrote: what i do not like that much is the introduction of some kind of a second hidden control flow.It is a "vertical" control flow, while the normal control flow is "horizontal". It allows you to program by assuming that things work. For example if you want to get a pack of beers, you need to put your shoes on, take your car, go to the store, find the aisle containing the beers, take a pack of beers, pay, take your car again, go back home. etc. All of these actions may fail individually but you don't want to write code to handle the innumerable failures that may happen. If anything fails, the relevant information is that you can't get the pack of beers and that's enough in many (if not most) cases. That's where exceptions come handy. If anything fails, an exception is thrown and that's what you get, but you can still write the code as if every operation was successful.
« We can solve any problem by introducing an extra level of indirection »