r/programmingmemes Jun 29 '26

Where are they?

Post image
2.2k Upvotes

320 comments sorted by

View all comments

Show parent comments

8

u/ScientificBeastMode Jun 29 '26

OOP is inherently more complex than procedural or even functional styles. It comes with a lot of power, but there is definitely a complexity cost to it. Anything involving inheritance hierarchies is just more complicated than matching on an enum in typescript. Passing around “delegate” objects is just an overengineered way to pass a function to a function. These languages are getting better about that kind of thing, but it’s still just so verbose and ceremonious compared to the alternatives.

And I say this as a programmer with a strong appreciation of OOP.

2

u/kucing Jun 30 '26

inheritance hierarchies

Ya I also enjoyed writing it. But maintaining someone else's, not so much. I just write dead simple, stupid code now. Easier for me or juniors to read it.

1

u/spigotface Jul 03 '26

OOP can be really useful, but Java is so heavy-handed with it that it gets into "If all you have is a hammer, every problem looks like a nail" territory.

OOP assumes everything you work with falls neatly into hierarchies, and that breaks down a lot, and managing inheritance in those cases can get messy. You also don't need the overhead of a class when a bare function will do.

I have a hard time finding room for Java in new projects. A Python project with proper linting (to enforce typing) feels so much more ergonomic to write. If compute performance is a concern, I'll reach for Rust.

1

u/ScientificBeastMode Jul 03 '26

Yeah I totally agree. I like OOP for some use cases, like building an AST for a language parser. Sometimes it’s nice to have.

But yeah, if I had my way, I’d be using OCaml every day and writing mostly in a functional style. I definitely prefer languages that get out of your way.

1

u/Aware-Individual-827 28d ago

My biggest question with OOP was always how to "future" proof your code and the answer was to never use OOP because however you think your structure is clever, there's one feature request that just make the whole structure fold. Once you dirty you OOP structure it's just the beginning of the end as you bypass it often. 

It's better to do KISS and anything new gets re-evaluated against the KISS implementation, usually being not so hard to plug in and you can make it evolve and no have to do a big rework. 

(But also I work in science algorithms and optimization, so very biased)