5 ms·
> An excellent counterpoint to object-oriented thinking. What exactly? That you can write code that isn't OO? That's hardly a surprise, given that code has be
by bhaak 12y ago
> An excellent counterpoint to object-oriented thinking.
What exactly?
That you can write code that isn't OO? That's hardly a surprise, given that code has been written in other programming paradigmas for 50 years, before and after the invention of great OO languages like Smalltalk.
Or that you can write good Python code without "self"? Also hardly a surprise, as the OO-ness has been tacked onto Python afterwards.
That's exactly the reason why there is the "self hell" in the first place.
- Peaker 12y ago> as the OO-ness has been tacked onto Python afterwards This is a myth, if I recall correctly. Python had the OO-ness from the very beginning. It might seem "tacked-on" if you dislike Guido's style of OO, though.
- bhaak 12y agoWell, they were added before the first public release (0.9.0 IIRC) but were not considered from the start and if I remember Guido's write-up correctly, it was more of a design hack because somebody mentioned with Python's internal design at that time, it would have been easy to add some sort of classes. I'm no expert in the internals of Python and its evolution, so I actually don't know how much that influenced the actual design of the classes later on but it always seemed plausible from what I've seen and also given the fact that Guido himself often says that the very first version didn't have a class statement.
- Peaker 12y agoDo you have a link to Guido saying that?
- bhaak 12y agoAn extensive discussion on the early implementation of Python classes: http://python-history.blogspot.com/2009/02/adding-support-for-user-defined-classes.html http://python-history.blogspot.com/2009/02/adding-support-fo... Or here in this also quite interesting talk about "21 Years of Python" hhttps://www.youtube.com/watch?v=ugqu10JV7dk&t=49m50s https://www.youtube.com/watch?v=ugqu10JV7dk&t=49m50s