for-to and do-x loops
So I was teaching java to a few members of my online community and a somewhat inexperienced programmer said something that made me think. He said "do you really have to do for(int i = 0; i < 10; i++) every time you want to go from 0 to 10?" Now that I think about it, it is kind of silly, isn't it? I don't know if this kind of construct exists elsewhere (in any other languages or perhaps somewhere deep in the Java abyss), but I figured I'd share my thoughts. So I came up with 2 possible syntactical solutions.
Thought that was interesting to think about. Hmm...
//the for-to loop
for(int i = 0 to 10)
for(int i = 0 to array.length)
//perhaps for(int i = 0 : 10) since "to" is not a keyword now,
//and changing it would mean breaking code
//the do-x loop