←back to thread

166 points todsacerdoti | 5 comments | | HN request time: 0.885s | source
Show context
seabass ◴[] No.44506423[source]
I love this sort of cs history. I’m also curious—why do we “throw” an error or “raise” an exception? Why did the for loop use “for” instead of, say, “loop”?
replies(7): >>44506448 #>>44506467 #>>44506568 #>>44506657 #>>44506785 #>>44506943 #>>44507014 #
flufluflufluffy ◴[] No.44506568[source]
I think “raise” comes from the fact that the exception propagates “upward” through the call stack, delegating the handling of it to the next level “up.” “Throw” may have to do with the idea of not knowing what to do/how to handle an error case, so you just throw it away (or throw your hands up in frustration xD). Totally just guessing
replies(1): >>44506618 #
1. owlbite ◴[] No.44506618[source]
I suspect it comes from raising flags/signals (literally as one might run a flag up a flag pole?) to indicates CPU conditions, and then that terminology getting propagated from hw to sw.
replies(3): >>44506683 #>>44506923 #>>44509728 #
2. comex ◴[] No.44506683[source]
I would have thought it came from the concept of 'raising an issue' or even 'raising a stink'.
3. Findecanor ◴[] No.44506923[source]
Sounds plausuble. Some of the earliest exception handling systems did not have any semantic difference between CPU exceptions and software exceptions.
replies(1): >>44510825 #
4. ◴[] No.44509728[source]
5. devnullbrain ◴[] No.44510825[source]
You can still use SIGUSR1 and SIGUSR2 for it.