r/programming • u/stesch • Aug 30 '08
Tour De Babel -- Rant about programming languages (at Amazon)
http://steve.yegge.googlepages.com/tour-de-babel
13
Upvotes
r/programming • u/stesch • Aug 30 '08
View all comments
Show parent comment
12
u/martincmartin Aug 31 '08
As someone who has used both (and also contributed to Groovy), I think the biggest difference is that Ruby has real anonymous functions, that can have an arbitrary number of statements/expressions in them. It makes dealing with any sort of collection much easier. Python's list comprehensions seem timid in comparison: they can only do "collect" and "grep," with single expressions, and the syntax for combining them is different than the rest of the language.
In Ruby, you can write a function which takes a file name and an anonymous function as arguments, then opens the file, passes it to the anon function, then closes the file in a "finally" block. It's much nicer than having to have explicit finally blocks.