Insights on Python (4)

Insights on Python (4)

Continuing from the previous article, after understanding class definitions and function definitions, we begin to learn about object-oriented programming, which has three main characteristics: encapsulation, inheritance, and polymorphism. Let’s learn about each of these: 🔒 Characteristic 1: Encapsulation The core idea: encapsulating data and methods together, hiding internal implementation details Detailed case: ATM machine class … Read more

Introduction to Object-Oriented Programming in Python: A Beginner’s Guide to the “Everything is an Object” Mindset

Introduction to Object-Oriented Programming in Python: A Beginner's Guide to the "Everything is an Object" Mindset

If you are just learning Python, are you still writing a bunch of messy functions? When you encounter repeated functionalities, do you copy and paste, and when you modify the code, does it affect everything? In fact, there is a more efficient programming method in Python—Object-Oriented Programming (OOP). It is like “bringing” real-world objects into … Read more

When Zhuangzi Meets Huawei Chips: This Lesson Made Students Exclaim ‘So That’s It!’

When Zhuangzi Meets Huawei Chips: This Lesson Made Students Exclaim 'So That's It!'

AbstractAbstract: The teaching of classical Chinese literature has long faced the dilemma of focusing on word translation while neglecting the text’s meaning, emphasizing knowledge transmission over the cultivation of thinking. “There are fish in the North Sea” is a classic opening text of “Zhuangzi: The Happy Wanderer,” serving as a core text that embodies Zhuangzi’s … Read more

Dispute Over Inheritance of Wills: Gu Jia A, Gu Jia B, Gu Jia C vs. Gu Yi B, Gu Jia D and Others

Dispute Over Inheritance of Wills: Gu Jia A, Gu Jia B, Gu Jia C vs. Gu Yi B, Gu Jia D and Others

1 Keywords Civil Law, Will Inheritance, Conditional Will, Will Obligations, Legal Obligations, Support Obligations, Hierarchical Comparison 2 Basic Case Facts The deceased Gu Moumou was the spouse of Shen Mou1, and they had seven children: Gu Jia A, Gu Jia B, Gu Jia C, Gu Jia E, Gu Yi B, Gu Jia D, and Gu … Read more

Python Classes and Inheritance

Python Classes and Inheritance

Introduction The mountains fade into the plains, and the river flows into the wilderness. Overview Basics of Classes Inheritance Polymorphism Encapsulation Multiple Inheritance Using the super() Function Class Methods and Static Methods <span>Property Decorators</span> <span>Abstract Base Classes</span> Basics of Classes What is a Class? A class is a template that describes the behavior and state … Read more

C++ Software Design: Design Patterns – 6. Liskov Substitution Principle

C++ Software Design: Design Patterns - 6. Liskov Substitution Principle

Original Book Cover: Guideline 6: Adhere to the Expected Behavior of Abstractions (Guideline 6: Follow the Expected Behavior of Abstractions) Reading Notes: 1. Explanation • Good abstract design should not establish inheritance relationships solely based on “what it is” but should judge based on “whether the behavior is consistent”. Subclasses must be able to seamlessly … Read more

Building Complex and Flexible System Architectures with C Language

In complex embedded systems (such as multi-device driver frameworks, protocol stacks, state machines), good code organization is often required. By using structures and function pointers, we can simulate the three main characteristics of object-oriented programming in C language: Encapsulation, Inheritance, and Polymorphism. Implementation of Object-Oriented Concepts in C Encapsulation Principle: Encapsulate data and operations on … Read more

Learning C++ Programming (Part 1)

As a professional in the surveying industry, merely using surveying instruments for measurement and software for drawing is far from sufficient. For instance, to process a batch of surveying data, one needs to understand programming to utilize computers for batch processing.Additionally, developing an internal data processing software also requires programming skills. Furthermore, modern three-dimensional urban … Read more

Advanced Python: 10. Classes and Objects

1. In Python, a class is a template for creating objects, defining the common attributes (data) and methods (behavior) of the objects; an object is an instance of a class, a concrete implementation of the class.The relationship between classes and objects: a class is like a blueprint for a car, specifying that the car should … Read more

Core Concepts of Object-Oriented C++: Classes, Inheritance, and Composition Explained!

In C++ Object-Oriented Programming (OOP), classes, inheritance, and composition are the three pillars for building complex programs. They not only help us achieve code reuse but also make the program structure clear and easy to maintain. Today, we will thoroughly understand these three core concepts from theory to practice. 1. Classes: The “Basic Unit” of … Read more