3 ms·
It was designed from the very beginning by Eich to look like Java and not because subsequent people tried to "fix" it. Where are you getting this stuff?
by manyoso 11y ago
It was designed from the very beginning by Eich to look like Java and not because subsequent people tried to "fix" it. Where are you getting this stuff?
- wnevets 11y agoES2015 just added the class keyword to make it look like java last year. IIRC the new keyword wasn't part of javascript in those first two weeks when javascript was released. Where are you getting this stuff?
- nilliams 11y ago'class' wasn't added to make it look like Java. It was added as sugar for a common pattern that everyone was already using. Many languages other than Java have a class keyword.
- wnevets 11y ago> Many languages other than Java have a class keyword. Yes many classical oop languages have the class keyword and that's why javascript added it.
- nilliams 11y agoBecause it's a useful pattern, that people were using heavily. Not sure why you're trying to suggest some kind of ill-intent. A nice thing about prototypal inhericance is that classical inheritance can be implemented in it. People were doing that commonly enough that it made sense to add sugar to do it more directly, and signal intent more clearly to the reader.
- manyoso 11y agoThe point is that Eich made Javascript use syntax and idioms from Java from the very beginning and it wasn't just later evolution of the language to "fix" it that did this.