3 ms·
I feel like, while using classical inheritance in JS is fine, it's an unfair simplification to say that creating classes in vanilla JS is painful. Prototypal in
by mistercow 14y ago
I feel like, while using classical inheritance in JS is fine, it's an unfair simplification to say that creating classes in vanilla JS is painful. Prototypal inheritance is more powerful than classical inheritance, and the reason it takes a bunch of boilerplate to implement classes in JS is that you're basically narrowing down to a less powerful model.
The trouble is that a lot less energy has gone into designing for non-classical prototypal inheritance, and what techniques exist are unknown to most programmers.
- _getify 14y agoI think you'll see in part 3 (should be published tomorrow) why I'm arguing that "objects-only" is the MUCH simpler way to get [[Prototype]] styled code (that is, "behavior delegation"). However, it requires you to stop using constructors and "new" and .prototype and so forth. Part 2 (today) will argue why all those things are actually "distractions" from the simpler model.