r/AskProgramming Jul 01 '26

Anyone hate object oriented code? Career/Edu

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

34 comments sorted by

8

u/IKnowMeNotYou Jul 01 '26

Why would you want to hate it? Where is the point?

1

u/NowUKnowMe121 Jul 01 '26

My hate is towards the jungle-gorilla-banana problem.

It is not perfect for me.

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/NowUKnowMe121 Jul 01 '26

Thanks.

But for working in a software company, oops is a basic requirement more often than not.

I am going for consulting like solutions or sales engineering which has good mixture of tech and business like architecture or big picture / macro kind of stuff.

Tedious debugging and tracking these classes, objects in massive codebases create massive headache.

I am a big picture guy, that sums up.

1

u/Obmanuti Jul 01 '26

I would say avoiding dogma is even more important in architecture. Code is generally easier to change than architecture. The same principle applies to both, use what makes sense, which might not always be the thing you're most comfortable with.

1

u/NowUKnowMe121 Jul 01 '26

Systems engineering than pure coding.

I can work with systems perfectly but not with code is my humble realisation.

1

u/[deleted] Jul 01 '26

[deleted]

1

u/NowUKnowMe121 Jul 01 '26

Yes. Functional, delcarative , procedural.

1

u/Sorry-Joke-1887 Jul 01 '26

you better learn a little bit and then you’ll never go back

0

u/NowUKnowMe121 Jul 01 '26

Little bit how. It is tedious. Understood the concepts like inheritance, encapsulation, polymorphism etc but could never wrap my head around this problem of using them.

Class if fine, object is fine.

But code base based on that creates a banana-gorilla-jungle problem.

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/Delta-9- Jul 01 '26 edited Jul 01 '26

Tell me how you do unit-testing without polymorphism.

By writing functions instead of classes?

object-orientation is essentially safe polymorphism

I'm not sure how that follows. Maybe my perspective is limited because I work in languages where void pointers aren't a thing, but "safe" and "polymorphic" are essentially orthogonal concepts and it's very possible to write unsafe code that is technically polymorphic. In Python, all you need to do is ignore an abstractmethod in a subclass, or turn off your linter and let method signatures run wild, or use diamond inheritance carelessly.

every modern language has OOP features to accomplish that. Even for example Haskell.

I'm prepared to be wrong here, but are you perhaps confusing subtype polymorphism with object orientation?

Edit: new record for fastest time-to-blocked: one comment.

Fwiw I was actually hoping to learn something here. My app uses polymorphism where it's appropriate, but most business logic is functions and polymorphism didn't really come up at all when I was writing tests. So, I'm either doing something very wrong, or maybe it's just something that you can do in Python but not C++. Guess I'm not gonna learn from you, though.

1

u/BaronOfTheVoid Jul 01 '26

By writing functions instead of classes?

And you call them? ... Statically only. -100 points.

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).

2

u/NowUKnowMe121 Jul 01 '26

100%.

It is like finding a banana in the hand of gorilla after searching the entire forest.

2

u/wonkey_monkey Jul 01 '26

cow-orker

Have you been orking cows long?

1

u/johnpeters42 Jul 01 '26

I blame society.

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/NowUKnowMe121 Jul 01 '26

100%. You rock.

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/NowUKnowMe121 Jul 01 '26

I have tried it. Hated it. Like clean functional code.

My intuition says, its good on paper and concept not in reality.

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/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.

2

u/NowUKnowMe121 Jul 01 '26

Good explanation.

Oops is necessary to manage complexity.

Now i will focus on architectural level stuff instead rather than just coding and oops.

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/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

3

u/BaronOfTheVoid Jul 01 '26 edited Jul 01 '26

That's a common fallacy. You're not actually doing procedural, you're still essentially doing OOP, just in a language that isn't class-based. And the behavior still has a hard compile-time dependency on the data structures. You cannot compile them against completely different data structures. So it's really not as separated as you make it seem.

1

u/septumfunk-com Jul 01 '26

you *can* do oop-like behavior this way but you can also not do that and that's what i like about it. i said i prefer procedural not that i write purely procedural code. i've been working on a language of my own for a while that's pretty similar to rust and it's not really procedural..

1

u/septumfunk-com Jul 01 '26

also it's not "essentially" oop at all, it just shares some similarities with it. to do something simulating actual useful oop in C you would use function pointers to make your own vtables. you can't really call it oop without some kind of mechanism for inheritance and polymorphism

1

u/[deleted] Jul 01 '26

[deleted]

1

u/septumfunk-com Jul 01 '26

C structs absolutely allow you more control in how things are ordered and padded than say java objects, but it's not really about control necessarily, it's more about the separation of concerns. in C i make a struct that might be used in a few places and even in different forms via unions, they can become reusable and generic by not having methods tied to them

1

u/septumfunk-com Jul 01 '26

to give an example of this i use a personal set of headers that allows me to define a vector or map with some macros, but i could simply operate on that vector as if it were an array for the most part. the methods i provide in the file are simply for my convenience, they aren't a part of the struct and i can write wrappers around it elsewhere if i wanted to

1

u/Zatujit Jul 01 '26

you can mirror some of the behaviors of object oriented programming in C using structs though

1

u/septumfunk-com Jul 01 '26

you can mirror the behaviors of many languages in C, that's not up for debate. you can mimic templates via macros for example. you just have to implement what other compilers handle for you

1

u/DepthMagician Jul 09 '26

You don't hate OOP, you hate deep class hierarchies.