Is C Language an Object-Oriented Programming Language?

Is C Language an Object-Oriented Programming Language? Abstract Object-Oriented Programming (OOP) is a programming paradigm centered around “objects,” characterized by encapsulation, inheritance, and polymorphism. This article argues that C language is essentially a procedural programming language by comparing the core features of OOP with the language design of C, supported by authoritative literature and language … Read more

How to Write Object-Oriented C Language?

In embedded system development, the C language dominates due to its proximity to hardware, efficiency, and portability. Although C is a procedural programming language, we can fully implement the core features of Object-Oriented Programming (OOP) through some programming techniques: encapsulation, inheritance, and polymorphism. Traditional C code has limitations, such as difficulty in managing global state, … Read more

Introduction to C++: Inheritance and Polymorphism

Inheritance One of the important features of C++ is code reuse. Through the inheritance mechanism, new data types can be defined using existing data types. The new data type not only has the members of the old class but also has new members. Class B inherits from class A, also known as deriving class B … Read more

Object-Oriented Design in Python: How to Elegantly Use Inheritance and Avoid Pitfalls?

In actual development, inheritance is a double-edged sword. When used well, it enhances code reusability; when used poorly, it becomes a maintenance nightmare. 1. The Essence of Inheritance: When Should Inheritance Be Used? Many developers have misconceptions about inheritance, believing it to be a universal key for code reuse. In fact, inheritance should serve two … Read more

C++ Inheritance and Constructors: A Beginner’s Guide from a Theoretical Perspective

Inheritance 1. What is the concept? Inheritance is essentially an extension of an existing class’s characteristics, adding new functionalities. The new class created is called a derived class, while the class being inherited from is called the base class. In fact, inheritance is primarily a form of reuse at the class hierarchy level. For example, … Read more

Understanding Inheritance in Python

The concept of inheritance (literally, think of inheritance as in family assets) In Python, inheritance is a core concept of object-oriented programming, allowing a class (called a subclass) to inherit properties and methods from another class (called a superclass). This mechanism promotes code reuse, enhances code maintainability and scalability. Through inheritance, a subclass automatically acquires … Read more

Learning Python – Object-Oriented Programming (OOP)

Learning Python - Object-Oriented Programming (OOP)

Object-Oriented Programming (OOP) is a programming paradigm that uses “objects” to design software and applications. Let’s delve into understanding Object-Oriented Programming in Python. 1. Core Concepts of Object-Oriented Programming 1. Class and Object Class: A blueprint or template for objects, defining the properties and methods of the object. Object: An instance of a class, having … Read more

The Correct Way to Open Python Classes: The First Step from Beginner to Advanced

The Correct Way to Open Python Classes: The First Step from Beginner to Advanced

Most people learning Python get stuck on “classes” at some point. When first encountering them, many feel, “This is so abstract, like the legendary programming black magic?” 😵 Don’t panic; classes are not that mysterious. You can think of them as common “molds” or “templates” in life. Just like a tailor needs a template to … Read more

Fundamentals of Object-Oriented Programming in C

Fundamentals of Object-Oriented Programming in C

What is Object-Oriented Programming (OOP) Object: Girlfriend, Boyfriend, Entity (an individual of a class of things) Type: Classification, Category The four main characteristics of Object-Oriented Programming: Abstraction: Abstracting things, abstracting properties, abstracting behaviors Properties: Common characteristics of a class of things, e.g., humans: age, name, ID, gender… Behaviors: Common behaviors of a class of things, … Read more

Class Inheritance in Python: From ‘Child Inheriting Parent’s Business’ to ‘Open-Closed’ Programming Philosophy

Class Inheritance in Python: From 'Child Inheriting Parent's Business' to 'Open-Closed' Programming Philosophy

In the programming world of Python 3.12, class inheritance has long transcended the superficial understanding of “subclass reusing parent class code” and evolved into a deep architecture that embodies software design principles, type system constraints, and code evolution capabilities. This article will reveal five core dimensions of class inheritance in the context of Python 3.12, … Read more