Mail

From Functions to Classes: My Journey Back to OOP in JavaScript

23 Jul 2025

Hey devs 👋,

Let me take you on a little time-travel.

Back in college somewhere around my second year. I was introduced to the magical world of Object-Oriented Programming. You know, the good old class, object, inheritance, and the legendary "Evergreen Library Management System" project. I was into it. I even tried implementing OOP concepts in small Java projects, and it felt like I had finally unlocked the Matrix.

But then...

I discovered web development.

HTML was welcoming. CSS was confusing. JavaScript? it was love at first script. ❤️

And that’s where I started shifting. Slowly away from OOP. I mean, JavaScript didn’t force me into OOP, and most of the tutorials, libraries, and frameworks I came across were all in on functional programming. It felt simple, elegant, and honestly, it just worked.

I started building projects with my friend. From basic websites to full stack applications. Life was good.

But then came my internship and suddenly, I was inside an enterprise-grade application, and reality hits. I think that’s enough let’s focus on the context now

1. The Functional World We Inherited

To be honest JavaScript has a weird relationship with OOP.

It supports it, but doesn’t enforce it. And most libraries especially the older ones lean heavily toward functional programming.

You’ve probably seen it:

And to be clear: functional programming is awesome. It’s powerful and elegant.

But when I started looking at large-scale applications during my internship. Every file was structured around classes, inheritance, design patterns, and I was like, “Wait, is this JavaScript... or did I accidentally open a Java repo?”

2. The Mindset We All Had: “OOP? that is over engineered”

When you're solving real-world problems with JavaScript, you might think:

OOP? Nah bro, I’ll just slap some functions together and hope for the best.

I get it. That mindset works fine for:

But in enterprise apps, it starts to show cracks.

You find yourself:

That’s when I realized structure, boundaries, and design principles matter.

I thought my code was modular until I tried to change one thing and 42 files broke.

3. So... Do We Need OOP in JavaScript?

Short answer? Not always.

Long answer? You’ll thank yourself for knowing it.

3.1. It Sharpens Your Thinking

OOP helped me think in terms of:

Suddenly, I wasn’t just writing code I was designing systems.

OOP turned my functions from anxious teenagers into responsible adults.

3.2. It Helps You Decode Complex Codebases

Ever opened a third-party library and felt like you were reading ancient alien scripts?

Well, OOP knowledge helps.

Understanding concepts like:

3.3. But Let’s Not Get Carried Away

I still stand by this:

Don’t over-complicate simple things.

If a function is just formatting a date? Keep it functional.

But when you're building a system that involves:

Then thinking in OOP terms will save you hours of debugging and countless “Why did I write this?” moments.

4. Me as a TS Dev Today

I like trying new patterns. I love tweaking things. I enjoy the freedom JS/TS gives me.

These days:

It’s not about “Functional vs OOP”.

It’s about knowing both, and using them wisely.

5. Finally, What I’m Really Trying to Say...

If you’re a JavaScript dev avoiding OOP because it feels like overkill trust me, I get it.

But here’s a pro tip from someone who took the scenic route:

👉 Even basic OOP understanding will level up your ability to read, write, and reason about code especially in large teams or codebases.

And don’t worry you don’t have to give up your arrow functions or map/filter/reduce.

You just need to add another tool to your belt.

So go ahead earn about class, constructor, extends, super, and all that jazz.

Even better: wait for my upcoming blogs. I promise it won’t be boring 😏

Functional and OOP aren’t enemies. They’re like Batman and Superman. Annoy each other, but stronger together.

Catch you in the next post 👋

Thanks again for reading!

Feel free to share this post with fellow devs — and if you’ve got feedback, ideas, or questions, I’d love to hear from you.

Stay Connected

GitHub •LinkedIn •X •Daily.dev •Email

Š 2025 Chiristo. Feel free to share or reference this post with proper credit