- Mastering JavaScript Object-Oriented Programming
- Andrea Chiarelli
- 240字
- 2021-07-14 11:24:30
Is JavaScript Object Oriented?
Once we have established the principles commonly accepted for defining a language as Object Oriented, can we affirm that JavaScript is an OOP language? Many developers do not consider JavaScript a true object-oriented language due to its lack of class concept and because it does not enforce compliance with OOP principles.
However, we can see that our informal definition make no explicit reference to classes. Features and principles are required for objects. Classes are not a real requirement, but they are sometimes a convenient way to abstract sets of objects with common properties. So, a language can be Object Oriented if it supports objects even without classes, as in JavaScript.
Moreover, the OOP principles required for a language are intended to be supported. They should not be mandatory in order to do programming in a language. The developer can choose to use constructs that allow him to create Object Oriented code or not. Many criticize JavaScript because developers can write code that breaches the OOP principles. But this is just a choice of the programmer, not a language constraint. It also happens with other programming languages, such as C++.
We can conclude that a lack of abstract classes and leaving the developer free to use, or not features that support OOP principles are not real obstacle to consider JavaScript an OOP language. So, let's analyze in the following sections how JavaScript supports abstraction and OOP principles.
- Web應用系統開發實踐(C#)
- Objective-C Memory Management Essentials
- 構建移動網站與APP:HTML 5移動開發入門與實戰(跨平臺移動開發叢書)
- 深入實踐Spring Boot
- Java軟件開發基礎
- R大數據分析實用指南
- PHP 7+MySQL 8動態網站開發從入門到精通(視頻教學版)
- C#開發案例精粹
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)
- Hands-On Neural Network Programming with C#
- Oracle數據庫編程經典300例
- Mastering Apache Storm
- Java多線程并發體系實戰(微課視頻版)
- 深入理解Java虛擬機:JVM高級特性與最佳實踐
- JavaScript Mobile Application Development