JavaScript fundamentally adopts Object-Oriented Programming (OOP) principles.
OOP, a programming paradigm, revolves around representing real-world...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
I think it's important to emphasize that Javascript is NOT "fundamentally" OOP.
All the class syntax brought in ES6 is just a syntactic sugar for what can be done with plain functions, closures, prototypes and stuff.
It's way different from Java's OOP, for instance.
I personally prefer to work with plain functions and modules instead of replicating classes in a language not made for such paradigm
Though I do not like the expression "syntactic sugar" we still have to state that the class concept of JS has some serial issues:
So, today you can use OOP methods in JS, but you cannot expect the same benefits like you get in other languages.
Oop not class!
here is no one “canonical” definition of OOP. There are at least two of them.
Two big schools of Object-Oriented Programming | stereobooster.github.io
TL;DR There is no one “canonical” definition of OOP. There are at least two of them. From my POV there are two big definitions, which deserves separate names. I named them after biggest advocates. Those two definition have some differences and some commonalities. I was about to get into another argue on OOP on the internet. I decided to do some research on the subject. I found more than one definition of OOP. Some of the definitions are variations of the same “tune”, some are useless. On my opinion there are two main directions of thoughts in this domain, which from two schools of OOP. School as in school of thought. The same way as there were philosophical schools in ancient Greece. The same way there are two schools of OOP: Alan Kay’s school or message focused Bjarne Stroustrup’s school or class focused or “PolymorphismEncapsulationInheritance” in terms of c2 I must emphasize that this article is not about what is best way to do OOP, because such discussion will lead to holy war. Instead purpose of this article is to help to recognize the fact that there are two ways to think about OOP. I believe this will help to build more constructive discussions about OOP. Next time you will start discussion on OOP or OOP vs make sure you know which school of OOP you are talking about. About names I choose Alan Kay and Bjarne Stroustrup as founders of schools, because they are big advocates of OOP and authors of first OOP languages of each school correspondingly. I’m aware that there are arguments on which programming language is the first OOP language and who invented OOP. See history section. Kay's school Stroustrup's school
If you look into history, you will find far more definitions, like "Objects exchanging messages". The class based approach in JS is clearly inspired by languages like C++, where OOP is more an extension to organize your procedural code.
Object Oriented Programming With JavaScript - Part 2 🚀
dev.to/alisamirali/object-oriented...