3 ms·
people keep wanting to make JS fit into the space of C#/Java OOP class-based stuff. Prototypical inheritance is so cool and useful and lightweight, this is quit
by soapdog 8y ago
people keep wanting to make JS fit into the space of C#/Java OOP class-based stuff. Prototypical inheritance is so cool and useful and lightweight, this is quite versatile once you understand the mechanisms and how to bind it. Why people keep trying to "fix" JS so that it conforms to their class-based expectations is beyond me. I like how it works now.
- protomyth 8y agoThey do that a lot. Look at Swift, its basically "I hate that Smalltalk-style stuff" and want my own version of C++. Java and JavaScript are examples of the same thinking. I often wonder what would have happened if Netscape had actually allowed a Scheme-like language in its browser.
- chriswarbo 8y agoI've seen this a lot, although personally I've come to prefer a functional programming style with closures for state (i.e. a poor man's Scheme), which means I also happen to avoid using "this", but not due to any love of OOP/C#/Java/etc.
- culturedsystems 8y agoI think you may be conflating two things here: C#/Java/etc style static OO vs Smalltalk/Python/etc dynamic OO, on the one hand, and class-based vs. prototype based OO, on the other. IMO most of the good bits of JavaScript's object system come from it being dynamic, not from it being prototype based (indeed, JS and Python's object systems are very similar, except that Python has language level support for treating some objects as representing types).