3 ms·
It added a bunch of other useful things, like getters/setters, constructor function, simpler method descriptions, etc. I don't have a problem with the class ti
by kowdermeister 9y ago
It added a bunch of other useful things, like getters/setters, constructor function, simpler method descriptions, etc.
I don't have a problem with the class title, after all it describes a class of things. When you extend something you really extend the scope of your class, so I still find it adequate.
There are differences in OO behavior between Java and C# but I haven't heard people complaining about naming classes classes.
- mileycyrusXOXO 9y agoThat is because Java and C# use classical OO. Javascript does not, it uses prototypal OO. Classes are static contracts that define the state and behavior of object instances. Javascript objects are not contractually obligated to have the state and behavior of a 'class'.
- kowdermeister 9y agoI know that and probably that's why people feel a bit annoyed by the Class keyword. However it's really close to what classes should represent. https://en.wikipedia.org/wiki/Class_(computer_programming) https://en.wikipedia.org/wiki/Class_(computer_programming) first two paragraph matches the JS use case well. > Javascript objects are not contractually obligated to have the state and behavior of a 'class'. I don't know what you mean by "contractually obligated", but if I instantiate a class in JS then it will have a state and behavior I defined in that class. If your problem is that if I change that class later, then the instances will change as well, then yes, it works like that. Calling something a class in my mind is not strictly limited to classical OO, it's just a loose concept different languages implement differently.