4 ms·
Out of curiosity, why do statics not count for class methods?
by i386 14y ago
Out of curiosity, why do statics not count for class methods?
- malbs 14y agoclass methods are virtual
- hboon 14y agoThey are closer to global functions that are attached to classes and don't support inheritance the same way as instance methods. e.g. if a subclass implements a static function with the same signature as its parent, and you call it with the parent class, it invokes the parent class version instead of the subclass version. Class-side methods in Smalltalk are inherited, working with classes (as an object) is analogous to how instance-side methods work with instances (also objects). So e.g implementing and using factory methods are simpler in Smalltalk and similar languages. Edit: grammer and typos.