ELI5: object oriented progamming
// explanation
What is object-oriented programming?
Object-oriented programming (OOP) is a way of writing computer code where you organize things into objects—like digital boxes that each hold their own information and instructions [5]. Think of it like having toy action figures where each figure has its own clothes, weapons, and special moves that only that figure knows how to do [4].
Why do programmers use it?
Programmers use OOP because objects can send messages to each other without needing to know how the other object works inside [2]. It's like two friends texting each other—they don't need to understand how the other person's phone works, they just send messages back and forth [2].
What are the main building blocks?
The four main ideas in OOP are encapsulation (keeping secrets inside your object), abstraction (hiding complicated stuff), inheritance (objects can be like family members with similar traits), and polymorphism (objects can do similar things in different ways) [4].
How do you organize code with it?
Instead of writing one long list of instructions, you create classes which are like templates or blueprints, and then you make objects from those templates [5]. If you wanted to make many video game characters, you'd create one character template, then make different characters using that same template [5].
// sources
Jan 17, 2015 ... An object-oriented program is composed of a graph of objects, each an island of state unto itself. Other objects do not read or write the state of other ...
Oct 1, 2021 ... The point of OOP is for objects to send and receive signals and they don't have to know a single thing about how each other work. If ...
Jul 23, 2016 ... I've been programming in Object Oriented languages for decades. The first OO language I used was C++ and then Smalltalk and finally .
Jun 27, 2018 ... The four principles of object-oriented programming are encapsulation, abstraction, inheritance, and polymorphism.
Sep 7, 2024 ... OOP is a programming paradigm that dictates the use of classes and Objects. Classes are how you define something to be, for example a vehicle, ...
Video by Programming with Mosh

Video by Code ON 코드온

Video by Computer Science Lessons
