Does class Availability makes programming as Object Oriented Language ?
Most of the people think that if there is Availability Class in a language, then that language becomes Object Oriented. Is it true ?
According to me, its not class that makes the language object oriented, but the OOP Concepts that makes the Language Object Oriented right ?
If Class makes a language object oriented then Javascript is not a object oriented language, but JS is a object oriented language without any Class being implemented.
It also brings me to ask one more question, Can we implement all the OOP Concepts in JS ? i.e
Inheritance
Data Abstraction
Polymorphism
encapsulation
Please let me know whether my understanding of JS is right or no ?
3
No, (1) classes don’t automatically make an object-oriented language nor does (2) lack of them make a language non-OO.
An example of (1) is Java: Java has classes, but that doesn’t make Java OO; in fact, classes in Java are used for defining Abstract Data Types, in order to define objects, you need interfaces. It’s the interfaces that make Java OO, not the classes.
An example of (2) is Self: Self is an object-oriented language with no classes.
JavaScript allows you to implement objects easily, by using what JavaScript calls “objects” (which are actually not objects in the sense of OO) in conjunction with closures. Whether or not that makes JavaScript an “object-oriented language” really depends on your definition of what an “object-oriented language” is. Is it a language which makes OO possible? Is it one that makes OO feasible? Is it one that makes OO easy? Is it one that guides you towards OO? Is it one that forces OO? Is it one that makes OO affordable?
You can use OO in assembly, if you want. Does that make assembly OO? (In fact, in one of his talks, Alan Kay has mentioned that he discovered a paper from 1953, which describes pretty much exactly his vision of OO, implemented in assembly.)
4