4 ms·
Usually I would be against simulating language features which aren't part of the language in the first place. JavaScript is kind of different, though. On the w
by wldlyinaccurate 13y ago
Usually I would be against simulating language features which aren't part of the language in the first place. JavaScript is kind of different, though.
On the web, many developers are "forced" to write JavaScript when they don't really understand it (which is a massive pet peeve of mine, but that's a rant for another time). These developers tend to try and shoehorn design patterns from their language of choice into JS, or they just don't use any design patterns at all. Either way, it just doesn't work; the code just ends up being horrible.
At least libraries like this allow people to use design patterns that are more familiar to them, which should (hopefully) result in cleaner code.
- Lerc 13y agoWhen I was starting out with JavaScript I had a little mantra that was "It's dynamic, stupid!" Which was almost always the answer to any point of confusion. Once I got around to seeing that object prototypes were just a tiny bit of magic glue, not only did the nature of constructor Functions make sense, but the inheritance mechanism became obvious. At that point JavaScript really transcends notions such as Multiple Inheritance because "It's dynamic, stupid!". Not only can you get the effects of Multiple Inheritance, but you can shift the object relationships around willy nilly. It's all just JavaScript. You are not so much adding a feature as creating an API to restrict your use of the natural ability in order to preserve your sanity.