by jsprogrammer · 11y ago · 0 comments
Because it's the shortest way to do it in that language.
I think something like:
[A-Z].reverse
or: reverse([A-Z])
might even be better. Do you know of a language with that syntax? for (1 = 65; i <= 90; i++){...}
It's not like the syntax is that bad. But, iterators are simpler than indexing a collection. Iterators work with data structures like linked lists where you don't really have an index. And, they work when the collection changes while you're iterating it.