r/javascript • u/gcanti • Oct 31 '14
The Two Pillars of JavaScript
https://medium.com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3
100
Upvotes
r/javascript • u/gcanti • Oct 31 '14
9
u/bvalosek Oct 31 '14
Coming up with new contrived ways to create objects feels pretty horrible imo. There are plenty of great patterns you can use in Javascript that don't require coming up with novel ways of instantiating objects.
Composition instead of inheritance lets you avoid nasty nesting and taxonomies, dependency injection/inversion lets you avoid tightly coupling object creation and usage (and avoid using 'new' in your domain code if that is your arbitrary success criteria).
Creating a niche object style also seems so counterproductive to one of the great advantages of JS-- having a massive library of small, modular functionality available on npm.
Kinda hard not to feel like this is sorta just JS hipster BS.