← Back to context

Comment by antod

6 days ago

I'm guessing "throw" came about after someone decided to "catch" errors.

As for "raise", maybe exceptions should've been called objections.

"Exception" comes from hardware/state machines, and the name reflects that they may not be error cases. For instance, if an embedded device is waiting for a button press, then pressing that button will put the MCU into an exceptional/special state (eg interrupting execution or waking up from sleep).

But surely those days are in the past. We should call them objections, because they're always used for errors and never for control flow. [1] After all, that would be an unconditional jump, and we've already settled that those are harmful.

[1] https://docs.python.org/3/library/exceptions.html#StopIterat...