git » homepage.git » master » tree

[master] / archive / forums / hacker-news / raw / items / 742408.json

{"by":"wooby","id":742408,"parent":741257,"text":"<p><pre><code>  Python                 Ruby\n  map                    collect,map\n  lambda                 block\n  filter                 select\n  ?                      reject\n  reduce (functools)     inject (native)\n</code></pre>\nGuido van Rossum on inclusion of 'reduce' in Python 3.0, in 2005:<p>\"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\" (<a href=\"http://www.artima.com/weblogs/viewpost.jsp?thread=98196\" rel=\"nofollow\">http://www.artima.com/weblogs/viewpost.jsp?thread=98196</a>)<p>Ruby lets you do it however you want to.  I don't see myself learning Python any time soon.","time":1249427379,"type":"comment"}