6 ms·
For clarity, what do you call "classical OOP"? (disclaimer: FP all the way, regardless)
by epgui 6mo ago
For clarity, what do you call "classical OOP"?
(disclaimer: FP all the way, regardless)
- hungryhobbit 6mo agoEssentially `new Foo()`, where `Foo` can be a subclass of `Bar` that inherits properties in the same way we all learned in our Java (or whatever actual OOP) language. JavaScript gives you a class syntax that lets you make classes and extend them from each other, and for the most part they will work the same way as a class from a language like Java ... but some things won't. You can either become an expert on prototype chains, and how JS actually implements OOP (differently from Java) ... or you can just write factory functions instead of classes.
- kretaceous 6mo agoCan you give examples of how they are different? I've only done OOP in JS so I'm not aware of what I'm missing or what's supposed to be different.
- epgui 6mo agoDon’t most OO languages have similar differences? My understanding is that even Java is quite different from, say, Smalltalk (which arguably is “more OG”).