
I spent two semesters learning object oriented programming and honestly, it was rough. The syntax wasn’t even the hard part. What really messed with my head was having to think about programs in a completely different way. You go from writing step-by-step instructions to thinking about objects that interact with each other.
How I Had to Rewire My Brain
With procedural programming, I’d think “first do this, then do that, then this other thing.” OOP turned that upside down. Suddenly I’m thinking “what things exist in my program, and how do they talk to each other?”
Here’s an example that really helped it click for me:
1 | from dataclasses import dataclass |
Instead of asking “How do I track task completion?” I started asking “What does it mean to be a Task, and what should Tasks be able to do?”
When Inheritance Finally Clicked
There’s this classic example that made it all make sense:
This shows how you can model real world relationships in code. Here’s how it works:
1 | from abc import ABC, abstractmethod |
SOLID Principles Aren’t Just Theory
We kept hearing about these SOLID principles. At first they sounded like academic BS. But turns out they do help. Take Single Responsibility Principle - basically each class should do one thing.
I used this to clean up my task manager:
1 | from typing import Protocol |
Design Patterns Just… Happen
Something that surprised me: design patterns aren’t just textbook stuff. They solve real problems. Like the Observer pattern - perfect for notifications:
Here’s mine:
1 | from abc import ABC, abstractmethod |
The Main Takeaways
Just because you can use inheritance doesn’t mean you should. Sometimes it’s cleaner to have objects contain other objects instead of inheriting from them.
And honestly, the interactions between objects matter way more than the objects themselves. The power isn’t in modeling individual things - it’s how those things work together.
Design patterns aren’t something you memorize. When you hit a problem, the pattern that solves it just makes sense.
The biggest thing though: good OOP takes practice. You gotta write some terrible code first to understand why all these principles exist.
I used a lot of this stuff when building Recess Chess with some classmates. Modeling chess pieces, game states, and player moves really showed me how useful OOP is for complicated systems.
If you’re learning this and it feels like too much, keep going. After you build a couple projects, it’ll click.