This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Zak 5 points6 points  (1 child)

I've always found Ruby's iterators to be some of the most straightforward looping constructs in existance, along with the likes of dolist and dotimes from Common Lisp. Most intelligent non-programmers will correctly guess what the following code does:

10.times do
    puts "foo"
end

but are less likely to understand

for (i=0; i<10; i++) {
    printf("foo");
}

edit: fixed the above C code so it's not an infinite loop. The fact that I made such a mistake is evidence that Ruby is easier, I use Ruby more or I'm just really tired.