Earlier quoted context omitted.
> just has an insane prototype based inheritance hierarchy that they're increasingly trying to hide/pave over. Can you elaborate more on why you think it is insane? I think it is quite elegant, and in my experience they only try to hide or pave over it because just so many damn people can't get over the fact that it isn't classical object oriented Also, for those who haven't read: http://javascript.crockford.com/inhe…
the way inheritance works in JS leads to a ton of inelegant design patterns that need to be remembered and very inefficient handling of many casts because the prototype chain is literally just a linked list. It also prevents sound encapsulation of class local variables and methods, the main point of object oriented programming in the first place.
Announcing Ionic 2 Final
81–82 of 82 posts
Re: Announcing Ionic 2 Final
#82Earlier quoted context omitted.
the way inheritance works in JS leads to a ton of inelegant design patterns that need to be remembered and very inefficient handling of many casts because the prototype chain is literally just a linked list. It also prevents sound encapsulation of class local variables and methods, the main point of object oriented programming in the first place.
There are many other languages that do not have multiple inheritance, or do not handle it the way you typically see in C++ or Java type languages, go being one of them, ruby another. Composition is more favored, and arguably a far better pattern regardless. I disagree with your assessment that it prevents sound encapsulation, and regardless, a better argument made against it is the fact that it is a dynamic language.…
Encapsulation isn't the "classic version" of OO. It's literally the main reason OO was created. Javascript fails to encapsulate because it doesn't support true private data members. There's patterns to achieve some sort of data safety (see http://speakingjs.com/es5/ch17.html#private_data_for_objects) but they all have disadvantages because it isn't built into the language, it's another hack.
Composition can be easily achieved using interfaces in most languages, another thing javascript doesn't support.
Excusing these faults to being dynamic language is like saying the model T is a nice car because "it was good for its time". Many languages before JS (including perl even) supported a more sound and convenient type system.
JS was badly designed in many ways and we are still paying the price for it today. ES6 and transpiling have made it finally worthwhile to try to develop anything significant using it which has led to the recent explosion of javascript development. I pray that EMCA continue to remedy what can be fixed in future and that Typescript catches on since it mows over much of the insanity.