- Learning Object-Oriented Programming
- Gastón C. Hillar
- 226字
- 2021-07-16 13:46:04
Object-oriented approaches in Python, JavaScript, and C#
Python, JavaScript, and C# support object-oriented programming, also known as OOP. However, each programming language takes a different approach. Both Python and C# support classes and inheritance. Therefore, you can use the different syntax provided by each of these programming languages to declare the Shape
class and its four subclasses. Then, you can create instances of each of the subclasses and call the different methods.
On the other hand, JavaScript uses an object-oriented model that doesn't use classes. This object-oriented model is known as prototype-based programming. However, don't worry. Everything you have learned so far in your simple object-oriented design journey can be coded in JavaScript. Instead of using inheritance to achieve behavior reuse, we can expand upon existing objects. Thus, we can say that objects serve as prototypes in JavaScript. Instead of focusing on classes, we work with instances and decorate them to emulate inheritance in class-based languages.
Tip
The object-oriented model known as prototype-based programing is also known by other names such as classless programming, instance-based programming, or prototype-oriented programming.
There are other important differences between Python, JavaScript, and C#. They have a great impact on the way you can code object-oriented designs. However, you will learn different ways throughout this book to make it possible to code the same object-oriented design in the three programming languages.
- Objective-C應(yīng)用開(kāi)發(fā)全程實(shí)錄
- INSTANT OpenCV Starter
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設(shè)計(jì)模式
- Django開(kāi)發(fā)從入門(mén)到實(shí)踐
- C#程序設(shè)計(jì)(慕課版)
- PySide 6/PyQt 6快速開(kāi)發(fā)與實(shí)戰(zhàn)
- Tableau 10 Bootcamp
- Kubernetes源碼剖析
- Rust游戲開(kāi)發(fā)實(shí)戰(zhàn)
- .NET Standard 2.0 Cookbook
- TypeScript 2.x By Example
- C語(yǔ)言從入門(mén)到精通
- The Statistics and Calculus with Python Workshop
- C++17 By Example
- Clojure Web Development Essentials