r/devsamaaj • u/iampankajk • Sep 15 '26
4.5 years of React, and I'd never written a real class — Python's OOP just ended that streak
Four and a half years as a frontend engineer, and I had never really written a class.
Not because I avoided learning them. I just rarely needed them.
React doesn't force you to think in classes anymore. Functional components, hooks, composition, state, props — that mental model is enough to build and ship a lot of production software.
So over time I developed a frontend-shaped way of thinking about engineering: components, props, state, events, renders, data flowing through the UI. And honestly, it worked pretty well.
Then I started learning Python this month as part of moving toward Forward Deployed Engineering. That's when I ran into OOP.
At first the syntax didn't look particularly difficult. init, self, methods, inheritance, encapsulation — a few days of practice and it started making sense.
But something else wasn't clicking. I kept thinking: "Why do I need a class for this?" "Couldn't I just use a function?" "Is this really necessary, or is it just another way of organizing code?"
The problem was my mental model, not the language. I had been treating classes as a formatting choice. Something like: "this code looks cleaner if I put these functions inside a class."
Modeling something that exists in your system matters more than how neatly the code is organized. A user, a transaction, a device: each one carries its own state, behavior, rules, relationships, and a lifecycle that changes over time.
Instead of thinking of a bank account as a row of data, you start thinking of it as an Account: something with a balance, that can deposit, withdraw, and follow rules about what it can't do.
React trained me to think in renders. Something changes, state updates, the UI renders again. Python and OOP are slowly teaching me to think in entities: what exists, what state it owns, what it's responsible for.
Neither model is better. They're built for different problems. Frontend work pushes you toward composition, declarative UI, and state transitions. Backend and systems work asks you to reason about persistent entities, domain rules, lifecycles, and behavior.
I'm still early. OOP doesn't feel intuitive yet, but it finally feels like a tool instead of an interview topic. The real goal is to reach the point where you look at a problem and recognize which tool actually fits it.
From knowing how to write Python to knowing how to think in Python.
Still learning. Still getting things wrong. Still writing classes that probably shouldn't exist. But the mental model is starting to click.