by Nevermindmyview · 7y ago · 0 comments
I don't know why you want to call that a "loop", but, sure, you do you, you crazy imperative programmers.
edit: Sigh. I was jockingly mocking.
How did he solve the iteration problem? A for loop is just syntactic sugar for a while loop.
They use enumeration (list/array traversal) to process a list/array of inputs.
And it entirely makes impossible the off-by-one error.
I am happy if I never have to see a for-loop again. (Even in JS, I use iteration/enumeration constructs as much as possible.)
It is one of several programming paradigms, after all. Am I missing something?
Maybe I should become a high school CS teacher, because I would not curse anyone with a procedural language.
Which is better? YMMV.
> I didn't know how to write a for loop
If