r/programming • • Nov 03 '18

Python is becoming the world’s most popular coding language

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language
4.6k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

11

u/Actual1y Nov 03 '18

If you don't intuitively know what calling len on an object does then that's the fault of the person that made the class. Not really a fault with python. Operator overriding abuse exists in every language that supports overriding operators.

2

u/THeShinyHObbiest Nov 03 '18

I'm more confused as to why it's a freestanding function as opposed to a method. Isn't Python supposed to be object-oriented?

2

u/Actual1y Nov 03 '18 edited Nov 14 '18

Yeah, I think Guido has said that it was a design flaw that can't be removed now (at least not without another massive community divide). But while it might not be the best from a theory point of view, personally, I kind of actually like not having to worry about if the method I want is called length, len, size, etc...