3 ms·
You can also use Object.create, __proto__ setter or a custom abstraction. However the constructor pattern is in practice used everywhere and I find nothing wron
by esailija 12y ago
You can also use Object.create, __proto__ setter or a custom abstraction. However the constructor pattern is in practice used everywhere and I find nothing wrong with it, in fact in the next language version it will get first class syntax through the `class` construct. People need to accept that same keywords mean different things in different languages, just because Javascript `this` and `new` are not like Java `this` and new` doesn't make it better or worse.
- pcthrowaway 12y agoOk, but wouldn't Object.create be more useful for when you are trying to shoehorn classical inheritance into Javascript? I still don't understand why he's implying (if I'm reading correctly) that using constructors is bad because you end up with the gorilla-holding-banana-and-forest problem that (he argues) comes with classical inheritance.
- jimmaswell 12y agoThat gorilla-holding-banana-and-forest problem is more of a boogeyman than anything.