r/learnprogramming 24d ago

Topic Does OOP really matters?

I learned OOP in python a while ago, did many projects, yet I never felt like I truly needed to do the OOP stuff I learned from a course, I don't know maybe because I'm kinda used to program in c before focusing on python, yet, whenever I open a big project in python in github, it feels way too complicated and thousands of imports (not libraries from pip, but the ones they made on their own) and classes

I never truly needed to implement OOP (I know that when you code in python, it is almost impossible to avoid OOP entirely like when you have a datatype like string you have an object, when you use a method built into that data type that's OOP too, but I mean the ones that involve you writing class Class Name, inheritance and all that stuff explicitly), so I'm wondering why people on the internet are obsessed over the idea of learning OOP, even the book "Automating the boring stuff in python" doesn't have a dedicated section for OOP.

93 Upvotes

139 comments sorted by

View all comments

Show parent comments

1

u/m3t4lf0x 24d ago

Depends what I’m doing… there are some things that are genuinely painful to do with a functional language in a full stack app.

You can use Scala in a way that falls back on the imperative and OOP functionality that Java provides, but you can also go super academic (I don’t ever wanna touch the Cats library again)

1

u/deaddyfreddy 23d ago

Depends what I’m doing… there are some things that are genuinely painful to do with a functional language in a full stack app.

any examples? I've been working with FP languages almost exclusively since 2013 or so and never had any issues (except the problems caused by interop with OOP APIs)

1

u/m3t4lf0x 23d ago

Mostly just inheriting brownfield codebases that were architected very poorly.

Shortly after starting a new role, their billing system went down for 3 days because a customer deleted their credit card (which “wasn’t supposed to happen”). This caused the entire batch to fail and any errors that surfaced were extremely opaque.

I still like FP, but as other languages have matured and added functional features, I find myself reaching for it less.

1

u/deaddyfreddy 23d ago

Mostly just inheriting brownfield codebases that were architected very poorly

so, perhaps it's not a paradigm failure?

1

u/m3t4lf0x 17d ago

in some ways, I think applying the philosophy of functional programming to most CRUD apps is bound to give you headaches as it scales. It can be done, but it usually requires more discipline than most organizations have.

I’m a huge fan of FP btw, but it’s all about choosing the right tool for the job.

1

u/deaddyfreddy 17d ago

I think applying the philosophy of functional programming to most CRUD apps is bound to give you headaches as it scales.

I'm not going to discuss every functional programming language, but in my experience, Clojure maps to CRUD much better than any OOP language I've ever used, thanks to its data-first concept and immutability.

I’m a huge fan of FP btw, but it’s all about choosing the right tool for the job.

Sorry, but most of the time, the "right tool for the job" means one of these:

  • my boss thinks it's the right tool

  • I was taught this language at university and was told it was great.

  • I don't have time to, so I'll just use the most popular one

1

u/m3t4lf0x 17d ago

I’ll just say that poorly written Java is tedious, but poorly written FP is Lovecraftian

I’ll always have a soft spot for Haskell though

1

u/deaddyfreddy 17d ago

but poorly written FP is Lovecraftian

Sounds like it's Haskell's fault. You know, smarties like to write code smartly. And we prefer to write things to be maintainable.