29 ms·
This is why I find prototype-based object systems so much more natural. Inevitably any dynamic object system ends up having to represent classes as objects, but
by rmckayfleming 4y ago
This is why I find prototype-based object systems so much more natural. Inevitably any dynamic object system ends up having to represent classes as objects, but that retroactively opens up a lot of mind-bending complexity. Prototypes on the other hand make far more sense in a dynamic context. You just create objects that you can clone and extend. Classes just become a design pattern. It also highlights that the interfaces of an object are more important than the class.
- skissane 4y ago> Classes just become a design pattern You haven't really got rid of classes though, you've just moved them from being explicit (something the language itself knows about) to implicit (something the developer keeps in their head). You still have some objects which play the role of "classes" (they are used as prototypes for other objects) and others which play the role of "instances" (no other object will use them as a prototype). How much of an improvement is there really if the concept still exists, but the language itself is ignorant of it?