Re:Ask HN: What language should I learn next?
by metaobject on Sunday April 06, 2014 @09:39AM
(#7540881)
What errors did python make wrt to design that were first found in smalltalk?
I remember reading somewhere that the OO system for python was sort of bolted on after the language had been around for awhile. When I write classes in python, there is something awkward about it that I just can't put finger on. I remember thinking it was strange to have to pass in 'self' to member functions, and then realizing that it was like 'this' in c++. So why does c++ hide that implementation detail while python lets that detail leak out? I wonder if 'self' could be passed in behind the scenes and any references to local variables that haven't been declared in that scope can be assumed to be instance variables.
I remember reading somewhere that the OO system for python was sort of bolted on after the language had been around for awhile. When I write classes in python, there is something awkward about it that I just can't put finger on. I remember thinking it was strange to have to pass in 'self' to member functions, and then realizing that it was like 'this' in c++. So why does c++ hide that implementation detail while python lets that detail leak out? I wonder if 'self' could be passed in behind the scenes and any references to local variables that haven't been declared in that scope can be assumed to be instance variables.