3 ms·
I never understood the whole confusion about prototypal inheritance. It's not harder to grok than classical inheritance. "Which Java developer doesn’t miss cla
by Raphmedia 9y ago
I never understood the whole confusion about prototypal inheritance. It's not harder to grok than classical inheritance.
"Which Java developer doesn’t miss classes when switching to a JS project?" ... That's the biggest problem here. Java != JavaScript. You shouldn't blindly carry concepts from one language to the other.
Adding syntactic sugar with the only goal of pleasing developers coming from other language goes against my view of what features should be added to a language. That's code bloat.
- dahart 9y ago> I never understood the whole confusion about prototypal inheritance. It's not harder to grok than classical inheritance. I'd guess, mostly based on my fuzzy memory of my first exposure to prototypal inheritance, that this confusion stems almost completely from the fact that prototypal inheritance is simply different from classical inheritance. Having come from a C++ world, I didn't realize there was another kind of inheritance, until I met JavaScript.
- masklinn 9y ago> I never understood the whole confusion about prototypal inheritance. It's not harder to grok than classical inheritance. In theory no, but Javascript has such bad support for it that it's syntactically inconvenient and you have to understanding significantly more details of the implementation to manage it than just "you add the other class after the extends".
- shados 9y agoPretty simple really: lots of people learn Java or other languages with similar inheritance models in school or very early in their careers from books/peers. It takes a while, and it's used in a lot of places. JS style inheritance is a bit more unique (compared to other languages commonly used on the job). Even though its arguably simpler, it's not something nearly as many people know, especially relative to how many people know JS. Thus it becomes this big scary thing. A bit like Monads that take minutes to learn but are scary because no one knows them.
- pducks32 9y agoAgreed. When I go from Ruby to Haskell I don’t try and eat hem to add Classes. That wouldn’t make sense. Why should JavaScript be different.