3 ms·
No, not the same. The general concepts are similar, though. My thinking goes: understanding classic OOP is helpful in learning JavaScript because the high leve
by g00gler 10y ago
No, not the same. The general concepts are similar, though.
My thinking goes: understanding classic OOP is helpful in learning JavaScript because the high level concepts are the same but in my opinion more obvious and easier to implement in Java/C#.
By more obvious, a Java/C# (+ others) program starts with a class and to add functionality you either have to add more methods to that class or implement another class. So to a new programmer "duh, everything is an object and objects are instances of a class".
It's kind of hard to convey the same idea to someone in JavaScript when {} is called an object, "xxx" is an object, and to compose a new class, you compose a new function.
However, to someone who already understands classes and objects, it's just a new/different way to create classes and objects.
- z3t4 10y agoTry not using prototype or class in JavaScript for a while, and you will do just fine without them. If there's a paradigm, or best practice, and you want to learn, don't follow it and see what happens.
- g00gler 10y agoI write procedural scripts all the time for just getting things done, often in JavaScript, Perl and PHP. I've only worked on one application written without any OO patterns, completely procedural, and it was a complete mess. Adding or extending features caused cascading bugs. Eventually we had to rewrite the backend (PHP) into MVC to be productive. I quit because I dreaded the work. I didn't want to write another line. I have been pretty interested in functional programming lately, or the functional paradigm everyone in JS is following nowadays, but haven't gotten the chance to take a deep dive yet.