Re:Google SoundScript: faster OOP for JavaScript
by coldtea on Wednesday February 04, 2015 @04:58PM
(#9000249)
>But in the prototypal school you don’t do any of that. You just make an object, if you don’t like the way it works you make another one and that is literally it.
Yeah, which goes to show you shouldn't listen to Douglas Cockford.
First, what he describes is playing in a REPL at best. You don't just "make another [object] if you don't like the way the fist one works" when you write a program, unless you write a structureless blob. You still have to think about your objects and/or inheritance chain, be it prototypal or not.
Second, ES6 classes are nothing more than syntactic sugar over barebones prototypal inheritance.
Third, you already do all that stuff in JS. You have to write a lot of boilerplate code (and usually everyone does a slightly different version) to get the same end result.
Yeah, which goes to show you shouldn't listen to Douglas Cockford.
First, what he describes is playing in a REPL at best. You don't just "make another [object] if you don't like the way the fist one works" when you write a program, unless you write a structureless blob. You still have to think about your objects and/or inheritance chain, be it prototypal or not.
Second, ES6 classes are nothing more than syntactic sugar over barebones prototypal inheritance.
Third, you already do all that stuff in JS. You have to write a lot of boilerplate code (and usually everyone does a slightly different version) to get the same end result.