Re:Ask HN: Resources for catching up on modern JavaScript fo...
by MoTTs_ on Thursday April 12, 2018 @02:52AM
(#16818578)
On the contrary, classes and inheritance in both Python and JavaScript behave basically the same. In Python, classes are objects (a building, not a blueprint), and inheritance is done by delegation.
https://i.imgur.com/p9Kw815.png
If you've used Python classes and inheritance all this time and never felt confused, then people can also use JavaScript's classes and inheritance and never feel confused.
Re:Ask HN: Resources for catching up on modern JavaScript fo...
by chrismeller on Tuesday April 10, 2018 @03:02PM
(#16804104)
I came from a C# background, not Java, but didn’t find anything supremely confusing about class inheritance in JS. Differences to be sure, but nothing that was groundbreaking.
Debugging I can see as being a reasonable argument - as you step through code you should understand what “proto” means. That’s the most compelling reason I’ve seen thus far...
It doesn't need to be extreme. I just recommended writing one or two "classes" using the old style, in the beginning, because that's a great way to solidify understanding of how the inheritance actually works. Whereas when you're using ES6 classes, you're using hidden abstractions that can make debugging very confusing if you don't know what the "class" keyword is doing.