3 ms·
The problem with Javascript's prototype system is that it's not a real prototype system - it's a chimera that's halfway between a traditional prototype system l
by ender7 14y ago
The problem with Javascript's prototype system is that it's not a real prototype system - it's a chimera that's halfway between a traditional prototype system like Self and a class system like Java.
The result is a system that is fit for neither paradigm. Trying to do work in either one requires a lot of extremely counter-intuitive lines of code that 'you just have to learn'. Unless you want your code to get bogged down such lines, you end up using libraries that allow you to write something that looks more like either Self or Java.
So, the problem isn't that people haven't bothered to learn 'the right way' to do protoclasses in Javascript. The problem is that 'the right way' is stupid. Either make a real prototype system or a real class system (or both!). But the reason that everyone is so unhappy with the state of things is because it sucks.