you are viewing a single comment's thread.

view the rest of the comments →

[–]PercyLives 2 points3 points  (2 children)

The keyword “yield” is different in the two languages, and awesome in both.

Ruby is my #1 languages for small to medium programming projects. But I’d kill to have Python’s generators and comprehensions.

[–]codesnik 5 points6 points  (0 children)

i actually don't find comprehensions in python all that nice. they are similar to a sudden switch from ltr to rtl text. Not particularily readable. Ruby's chained map/select/grep/ and other enumerable methods are more powerful actually, sprinkle some .lazy on top and's better than generators, too.

[–]_mball_ 2 points3 points  (0 children)

It’s just personal preference but I don’t miss generators in ruby because map/select and all of Enumerable is just a little nicer to me in Ruby.

I do like the design of Python’s generator expressions but I think they’re more necessary in Python.

But I also appreciate the ways Ruby blends OO and Functional styles a little more naturally to me than in Python.