3 ms·
Javascript is not readable to you because you're attempting to apply OO patterns to it. Javascript is not an OO language, it doesn't work like that. It is an
by marcus_holmes 11y ago
Javascript is not readable to you because you're attempting to apply OO patterns to it.
Javascript is not an OO language, it doesn't work like that.
It is an incredibly powerful and elegant language, please take the time to learn how it works and appreciate its beauty. Then by all means make suggestions about how it should be changed. But only then, please.
Not all languages would be improved by being "more like Python".
- aikah 11y ago> Javascript is not an OO language, it doesn't work like that. What ? it certainly is today with the "class" syntax. Or it is like saying neither Ruby or Python are object oriented. > elegant language, Elegance is in the eye of the beholder
- angersock 11y agoMinor point of order...Ruby is OO because it very much follows the Smalltalk-style message-as-function-invocation pattern. Javascript (at least before ES6) is perhaps too minimal in its language affordances to qualify for "true" OO status.
- marcus_holmes 11y agothere's a lot of people who objected to adding "class" syntax to Javascript purely for this reason. Javascript objects are not the same things as Python (or Smalltalk) objects, they don't work the same way and were never intended to. There is a good case to be made that Smalltalk-type OO with multiple inheritance (like Python) is a bad thing. Javascript's type of OO is a good way of avoiding that bad thing. I agree that elegance is purely subjective, and if you choose not to find javascript elegant because it lacks a certain "python-ness" then that's entirely your decision. However I would encourage you to expand your horizons a bit and stretch your understanding a little more.