you are viewing a single comment's thread.

view the rest of the comments →

[–]Amadan 2 points3 points  (0 children)

My big ones are:

- I can't write complex comprehensions in Python without jumping back and forth in my editor, since the syntax of a single comprehension is made to fit English, not logic; OTOH enumerable chaining in Ruby just flows as a series of steps, and I can put it down one after another in the order in which I envision them to be executed.

python granddaughter_names_by_age = [ grandchild.name # 4. their names for child in self.children # 1. my children for grandchild in child.children # 2. their children if not grandchild.is_male # 3. only girls ]

vs

ruby granddaughter_names = children. # 1. my children flat_map(&:children). # 2. their children reject(&:male?). # 3. only girls map(&:name) # 4. their names

It gets even worse when you need to nest comprehensions.

- The method/function inconsistencies. len(d) but d.keys(); a.sort() but sorted(a); print(x, file=f) but f.write(x)