←back to thread

166 points todsacerdoti | 1 comments | | HN request time: 0.206s | 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 #
titanomachy ◴[] No.44506467[source]
That's a great question. The first language I learned was python, and "for i in range(10)" makes a lot of sense to me. But "for (int i = 0; i < 10; i++)" must have come first, and in that case "for" is a less obvious choice.
replies(3): >>44506505 #>>44506536 #>>44506602 #
1. QuesnayJr ◴[] No.44506602[source]
Algol 58 had "for i:=0(1)9". C's for loop is a more general variant.