In particular, I don't like the fact the for-loops are often used in first examples. I had that issue when I looked at tutorials for D and Go for the first time. My initial reaction was "Seriously?"
In particular, I don't like the fact the for-loops are often used in first examples. I had that issue when I looked at tutorials for D and Go for the first time. My initial reaction was "Seriously?"
One thing I like about python loops, which CoffeeScript and Ruby, and apparently Nimrod, have adopted as well, is that they make you iterate over a data structure, rather than the C-style of providing start, finish, and step. Iterating over a data structure provides a better guarantee that the loop will terminate without errors (whereas, in Java for example, you could fall off the end of a linked list or an array if you're not careful about your ending test or update step). This ends up being conceptually similar to a map, which is how Ruby's each method works anyway.
for (Foo foo : foos) {
...
}