Understanding OOP with a Class Blueprint

I spent weeks writing Python without truly understanding OOP. I knew what a class was. I could copy the syntax. But I didn't really get it. Then one session at StemLink changed how I see it. 🧬 Here's the honest story of how OOP finally made sense to me 👇 --- Before OOP, my code looked like this: name = "Abiya" age = 20 course = "CS" def greet(name):   print(f"Hi, I'm {name}") Just variables and functions floating everywhere. No structure. No connection between them. --- Then I learned: a Class is just a blueprint. class Student:   def __init__(self, name, age):     self.name = name     self.age = age   def greet(self):     print(f"Hi, I'm {self.name}") me = Student("Abiya", 20) me.greet() Now the data and the behavior belong together. That's it. That's OOP. --- The 4 pillars — simplified: 🔷 Encapsulation → keep data and methods inside one class 🔷 Inheritance → one class can extend another 🔷 Polymorphism → same method, different behavior 🔷 Abstraction → hide complexity, show only what matters I used to memorize these definitions for exams. Now I actually use them when writing code. --- The mindset shift: Stop thinking in steps. Start thinking in objects — what things exist, what they know, and what they can do. That shift made me a better programmer. What OOP concept took you the longest to understand? 👇 #Python #OOP #ObjectOrientedProgramming #StemLink #IITColombo #CS #LearnToCode #StudentDeveloper #BuildInPublic

  • diagram

To view or add a comment, sign in

Explore content categories