News for hackers. Stuff that matters.
Re:Python vs Ruby, slightly more in-depth by wooby on Tuesday August 04, 2009 @07:09PM (#742408)

  Python                 Ruby
  map                    collect,map
  lambda                 block
  filter                 select
  ?                      reject
  reduce (functools)     inject (native)
Guido van Rossum on inclusion of 'reduce' in Python 3.0, in 2005:

"This is actually the one I've always hated most, because, apart from a few examples involving + or *, almost every time I see a reduce() call with a non-trivial function argument, I need to grab pen and paper to diagram what's actually being fed into that function before I understand what the reduce() is supposed to do. So in my mind, the applicability of reduce() is pretty much limited to associative operators, and in all other cases it's better to write out the accumulation loop explicitly" (http://www.artima.com/weblogs/viewpost.jsp?thread=98196)

Ruby lets you do it however you want to. I don't see myself learning Python any time soon.

There are no comments on this comment yet.