- 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.
- Boost.Asio C++ Network Programming(Second Edition)
- AngularJS入門與進(jìn)階
- 架構(gòu)不再難(全5冊)
- C#程序設(shè)計教程
- GitLab Repository Management
- Blender 3D Incredible Machines
- 老“碼”識途
- Mastering Predictive Analytics with Python
- C語言程序設(shè)計學(xué)習(xí)指導(dǎo)與習(xí)題解答
- 微信小程序入門指南
- Python開發(fā)基礎(chǔ)
- Python網(wǎng)絡(luò)爬蟲實例教程(視頻講解版)
- Functional Python Programming
- MATLAB 2020 GUI程序設(shè)計從入門到精通
- Java RESTful Web Service實戰(zhàn)