r/programming • u/stesch • Aug 30 '08
Tour De Babel -- Rant about programming languages (at Amazon)
http://steve.yegge.googlepages.com/tour-de-babel
10
Upvotes
r/programming • u/stesch • Aug 30 '08
View all comments
Show parent comment
2
u/twotime Aug 31 '08
I agree with you on map/reduce (they utilize a low-level property of objects (iterability)).
But len() is a somewhat different beast: is not it defined as
def len(x): return x.len()
and to support len() a class must define method len()?
So why not require every object to define method len() and get rid of len() builtin?
Is there any benefit to len(x) over x.len()?
(at the very least: x.len() removes an extra level of indirection)
E.g python does not have read() builtin (which just calls read method), instead you simply define a read()method when you need it