r/AskProgramming • u/NowUKnowMe121 • Jul 01 '26
Career/Edu Anyone hate object oriented code?
Dont like oops.
How do you guys manage it?
Like only functional and procedural prograing :)
My hate is towards the jungle-gorilla-banana problem whereas functional programming seems clear, brezzy and maintain codebase rather easily.
0
Upvotes
7
u/IKnowMeNotYou Jul 01 '26
Why would you want to hate it? Where is the point?
2
u/Obmanuti Jul 01 '26
A zealot is still a zealot even if what they believe has been correct for the situations they've been in. Your goal should not be to follow one dogma or another, it should be to choose the right approach for the task. These paradigms don't come into existence because someone wanted to ruin your day, they came into existence because they solved a problem. Understanding which approach to use and when is what makes a good software engineer, not blind adherence to an idealogy you read in a medium article.
1
u/Sorry-Joke-1887 Jul 01 '26
you better learn a little bit and then you’ll never go back
1
u/johnpeters42 Jul 01 '26
I only hate it when I have to wade through a former cow-orker's lasagna code (these six layers of objects could've been two).
1
u/_gribblit_ Jul 01 '26
I manage it by never tainting my fingers with filthy OO languages. It's Haskell and Lean4 or nothing.
1
u/Pale_Height_1251 Jul 01 '26
If you're a beginner, I would reserve judgement until you have learned what OOP is for.
1
u/JackTradesMasterNone Jul 01 '26
For my own personal projects they're often overkill. For enterprise grade software? I think it's critical. It's much more logical to translate business entities into nouns (objects) than verbs (actions).
When your problem is small, you start with whatever works. When your problem gets bigger and your scope does, then that needs some optimization.
1
u/BaronOfTheVoid Jul 01 '26 edited Jul 01 '26
Tell me how you do unit-testing without polymorphism.
That's right, you don't. And since object-orientation is essentially safe polymorphism as opposed to toying around with void pointers etc. every modern language has OOP features to accomplish that. Even for example Haskell.
1
u/Lumethys Jul 01 '26
no
1
u/Delta-9- Jul 01 '26
Use it where it makes sense.
Don't use it where it doesn't.
OOP is fine in principle, and you can do FP with objects. Some languages take it too far (Java, C#), but it's a great tool to have in your multiparadigm language. Objects basically accomplish the same thing as a Reader/State monad, but with less headache to learn and use. They're literally just a bunch of closures in a namespace.
1
u/mredding Jul 01 '26
After 37 years of C++, I'm certain the industry effectively has zero clue what OOP actually is. I've never actually seen true OOP out in the wild, and those who actually know and understand the paradigm aren't actually allowed to write such code at work, yet their employer still calls their product OOP.
Most of the code I see is procedural and imperative programming, C with Classes, and a total disheveled mess that demonstrates the authors are all just hacks with absolutely no grasp of programming idioms or paradigms.
So when you say you hate OOP, I don't actually believe you know what you're talking about - not by any fault of your own, but because the industry is the blind leading the blind. Your teachers didn't know what OOP is, so WTF did they teach you?
I think you just hate slop.
I hate OOP. It has its graces, it has its elegance, but it's a paradigm based on an ideology - like a religion, whereas FP is based on mathematical principles. There are many faults within OOP, which I'm not going to enumerate here, but I can summarize them all by saying FP is consistently 1/4 the size and 8x faster than equivalent OOP solutions.
1
u/DepthMagician Jul 09 '26
You don't hate OOP, you hate deep class hierarchies.
1
u/septumfunk-com Jul 01 '26
i don't hate it but i prefer procedural. i write C, and the main way you "manage it" is by simply using structs making use of composition instead of inheritance, and you pass pointers to those to functions. i prefer this because it allows the mechanics of structs to be well separated from the functions that operate on them, or in other words plain ol' data. one struct may have many uses but that struct is clearly defined separately from its behavior and can stand on its own
0
u/[deleted] Jul 01 '26
[deleted] — view deleted comment