2 ms·
> I consider it a mistake on the part of Python to go with self rather than this self makes more sense though. And smalltalk used self. And so did (obviously)
by masklinn 6y ago
> I consider it a mistake on the part of Python to go with self rather than this
self makes more sense though. And smalltalk used self. And so did (obviously) Self.
The most important part is to not use both (which of course is what PHP does).
- m_t 6y agoYeah but to quote stackoverflow: > Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members. This is a different way of doing things, yes, but it makes sense.