3 ms·
Single inheritance prototype system is actually something I like about js. I'm wondering why you consider it awful?
by ChrisSD 9y ago
Single inheritance prototype system is actually something I like about js. I'm wondering why you consider it awful?
- cpburns2009 9y agoIt's too ad-hoc and over-complicated to implement common things such as classes and interfaces. In JavaScript you're essentially stuck with stringly typed values and chaining mix-ins together to emulate a class hierarchy. It's also difficult to get instanceof to work as one would expect. The other languages I'm used to all natively support it: Python and Java. Granted, Java is single-inheritance too but you can implement multiple interfaces.
- ChrisSD 9y agoAh yes if you're thinking in terms of classes then that would be frustrating.
- WhatNotAboutism 9y agoEven with the most ubiquitous language in the world using prototypical inheritance, the average (mean) programmer prefers to imagine and express themselves in an inheritance based system. At some point, everyone will have to accept that prototypical approach is fine for some, but less productive over time for the world.