← Home ← Back to /g/

Thread 106208779

130 posts 30 images /g/
Anonymous No.106208779 >>106208807 >>106208868 >>106208886 >>106208909 >>106209595 >>106210608 >>106210852 >>106210902 >>106210971 >>106212250 >>106213029 >>106214077 >>106217535 >>106218028 >>106219014 >>106221279 >>106221595 >>106222494 >>106222505 >>106222515 >>106224282 >>106224336 >>106227684
why do retards hate OOP so much?
literally all good code is object based.
Anonymous No.106208807 >>106208816 >>106208831 >>106208856 >>106209021 >>106209187 >>106225309
>>106208779 (OP)
1. it come with wrong memory usage and spamming new()/free() , it make it more slow than python and make it crash often
2. it come with STL/boost shit with is no any faster than python
3. 99% cases namespaces is enough
Anonymous No.106208816 >>106208845
>>106208807
OP never mentioned C++
Anonymous No.106208831
>>106208807
>make it crash often
maybe if you're retarded
>it make it more slow than python
lol
Anonymous No.106208841 >>106208901 >>106209009 >>106210687 >>106214414
Literally all good code is written in C, which is objectively not object based you retard.
Anonymous No.106208845
>>106208816
3. 99% cases namespaces is enough
Anonymous No.106208856
>>106208807
>3. 99% cases namespaces is enough
i use real OOP only once in my live, it was UI for microcontroller
it was written on clear C
Anonymous No.106208868 >>106213481
>>106208779 (OP)
OOP makes it easy to hide incompetence with formalisms.
Anonymous No.106208886 >>106209021 >>106209024 >>106212972
>>106208779 (OP)
Its main strength is that it's an intuitive way to define and describe things. Its main issue is unoptimized CPU cache usage, poor memory locality and slower code (vtables, etc), all of which DOD handles better.
Anonymous No.106208901 >>106209034 >>106213993 >>106222494
>>106208841
>which is objectively not object based
yet everyone just treats it like cpp anyway by putting everything in structs and writing their own constructors and destructors and even using pointers to mimic virtual functions. you're fucking retarded if you think C has any advantages over cpp whatsoever, the only reason to use it is to be a contrarian.
Anonymous No.106208909 >>106209024
>>106208779 (OP)
oop kills performance in my experience by doing too much unneeded work
Anonymous No.106208943 >>106208965
They never had a single lesson for PLT.
They don't know what is an abstraction technique.
They can't implemented a single design pattern.
They never did anything relevant and consistent enough that the adoption of an abstraction technique over another would matter.
Anonymous No.106208965 >>106209277
>>106208943
fuck off, teacher who cant code
Anonymous No.106209009 >>106209076
>>106208841
> Literally all good code is written in C
You don’t need the “good” in there.
Everything is, or was originally written in C.
C++. Java. Rust. Go.
C++ itself was a transpiler to C, which was then compiled (cfront).
It’s C all the way down.
Anonymous No.106209021 >>106209082
>>106208807
>>106208886
Blame the language designers for popularizing the heap based approach with garbage collection for OOP. OOP doesn't require heap based allocation and isn't much slower, it all depends on how you draw encapsulation boundaries for objects. If you have an object encapsulate a large array that it works on, it isn't going to be much slower for that one vtable call to work on it.

Don't do vtable lookups / dynamic dispatch in tight loops and have an objects deal with a large amount of data vs dealing with each item separately.

Sometimes a vtable is what you want, but the question is more how often and where and why are you using it.
Anonymous No.106209024 >>106209038 >>106209053 >>106219131
>>106208886
>>106208909
here are the inevitable LARPers who have to pretend performance matters in 2025 because it's the only possible defense for their contrarianism
Anonymous No.106209034
>>106208901
No dumbass, I treat CPP like C.
Anonymous No.106209038 >>106209065
>>106209024
So uh, do you have any argument? Or do you just pretend criticism is invalid because you make up imaginary scenarios about the people who are dishing out the criticism?
Anonymous No.106209053 >>106210593 >>106219160
>>106209024
actually I work on a platform getting millions of hits a day and we waste 250ms+ per request by faggots coding $a = MyReallyImportantLibrary->new( $b->id );
Anonymous No.106209065 >>106209106 >>106209142
>>106209038
It's a non-issue. Your boss or QA never once said to you "this runs too slow" or "this uses too much memory" anytime in the past 5 years except for database issues. Maybe if you work with 3d graphics or something but the vast majority of devs none of this shit fucking matters
Anonymous No.106209076
>>106209009
it's still C
C is the only language I fully know, or C++/11
I write PS and Rust now, people ask how I know what methods are doing
Anonymous No.106209082 >>106209113
>>106209021
just use clean C
Anonymous No.106209086 >>106209092 >>106209104
you can't implement ffmpeg without OOP
Anonymous No.106209092 >>106212520
>>106209086
>OOP
(You) mean pointers on functions?
Anonymous No.106209104
>>106209086
ffmpeg turns into machine code at the end, so by definition it's possible to write that machine code
Anonymous No.106209106 >>106209175
>>106209065
So it's relevant for billion dollar industries like video games & CGI and for essential tools like compilers & operating systems?
Anonymous No.106209113
>>106209082
I use Forth.
Anonymous No.106209142 >>106209161 >>106209203
>>106209065
what about automotive, aerospace, military, medical, or financial where there's legally required worst-case operating times on every single instruction?
Anonymous No.106209161 >>106209192
>>106209142
Nobody’s done that in years.
There’s developers that are *able* to do it.
Take tesla, for example. The real-time code for the braking system was written ages ago and uses 68000 processor cores to execute that ancient code.
Anonymous No.106209175 >>106213490
>>106209106
no compiler in history was written without OOP
Anonymous No.106209187 >>106209243
>>106208807
>it come with
Anti-OOP types are ESL retards. Is anyone surprised?
Anonymous No.106209192 >>106209297
>>106209161
>nobody's done that in years
what's the alternative?
Anonymous No.106209203
>>106209142
sounds like LARP to me
Anonymous No.106209243
>>106209187
AHГЛИЙCКИЯ ЯЗЫК ЭTO AДAПTAЦИЯ ЛATЫHИ ДЛЯ OCTPOBHЫХ OБEЗЬЯH
Anonymous No.106209247
OOP with inheritteance only where truely needed is good. Mixins fix a lot of the issues with OOP
Anonymous No.106209277 >>106209300 >>106209310 >>106213500
>>106208965
Read uncle bob. Your llm agents will not rescue you from your mediocrity.
Anonymous No.106209297 >>106209343
>>106209192
Hire some old white or japanese guys.
Such as myself.
Anonymous No.106209300
>>106209277
reading billions of shitty "programming" books for retards is waste of time
professionals reads only source codes
Anonymous No.106209310
>>106209277
> Read uncle bob
Never heard of this guy until recently.
Snake-oil salesman.
Anonymous No.106209343
>>106209297
no i mean explicitly the alternative approach you dumbass
Anonymous No.106209372
>real-time code
>worst-case operating times on every single instruction
demo/game retro computer coders can do it
Anonymous No.106209595
>>106208779 (OP)
>why do retards hate OOP so much?
Because it's what made them retarded.
Anonymous No.106210593
>>106209053
That syntax makes me think that the real problem is that you subhumans spawn a new PHP interpreter for every connection and new object allocation is a red herring.
Anonymous No.106210608 >>106210634
>>106208779 (OP)
Alright anon all say it with me:

STUPID
FROG
POSTER
>:(
Anonymous No.106210634
>>106210608
Hurtful.
Anonymous No.106210687
>>106208841
Bro doesn't know about GObject
Anonymous No.106210852
>>106208779 (OP)
I write object-oriented python
Anonymous No.106210902
>>106208779 (OP)
stop editing pepes to avoid my frogposter filters. or ill scream.
Anonymous No.106210971 >>106211792
>>106208779 (OP)
Its abstractions are inaccurate to how machines work.
Anonymous No.106211792 >>106211895
>>106210971
that's literally the point of abstraction from hardware
Anonymous No.106211895 >>106212166
>>106211792
The point of abstraction is to make everything inefficient with 0 benefit?
Anonymous No.106212077 >>106226708
come home white man
Anonymous No.106212166 >>106212223 >>106213528
>>106211895
>0 benefit
It makes it easier for humans to read, write, understand, and debug. That's the whole point of high level programming languages in general. Your argument is an argument against C itself. You might as well go write in Assembly or pure binary if hardware adjacency is your only concern.
Anonymous No.106212223
>>106212166
Real humans got replaced by H1B subhumans, you can't really argue that abstractions benefit humans.
Anonymous No.106212250
>>106208779 (OP)

there is a learning curve to OOP. getting chatgpt to generate me procedural php which I don't even read is easier.

t. chatgpt vide coder
Anonymous No.106212520 >>106212571
>>106209092
ffmpeg solves a problem that requires OOP solution. it operates on classes of objects. it doesn't matter how you implement it, but by using OOP language you can make solution more elegant.
Anonymous No.106212571
>>106212520
ffmpeg solves a problem that doesn't exist
Anonymous No.106212972 >>106213650
>>106208886
>unoptimized CPU cache usage, poor memory locality and slower code (vtables, etc)
Right, the code you write is slow because of THAT, not your shitty programming skills
Anonymous No.106213029
>>106208779 (OP)
watch this OP, hopefully you'll understand
https://www.youtube.com/watch?v=SxdOUGdseq4
Anonymous No.106213092 >>106213541
Just use CLOS for good OOP
Anonymous No.106213304
i only program in bare metal. code is for faggots i just burn a new FPGA every time i need a new feature
Anonymous No.106213481
>>106208868
>OOP makes it easy to hide incompetence with formalisms.

Based chad.
Anonymous No.106213490
>>106209175
>no compiler in history was written without OOP

Lol, you're a kid, right?
Anonymous No.106213500
>>106209277
>Read book of boomer that has never written real mission critical code for money

Uncle bob should be shot.
Anonymous No.106213528 >>106213940
>>106212166
>That's the whole point of high level programming languages in general

Thinking "OOP is the highest level" only makes sense if this is year 1980.
Anonymous No.106213541
>>106213092
>Just use CLOS for good OOP

Chad

But CLOS' OOP is diametrally different from C++/Java and far more powerful. Like the difference between a car dashboard and a plane cockpit.
Anonymous No.106213650 >>106213710 >>106213833
>>106212972
It's literally an objective fact about OOP my shitskin friend.

Try to guess why objects containing irrelevant details during certain tasks leads to nonoptimal CPU cache utilization.
Anonymous No.106213710
>>106213650
I'm not saying you're wrong, I'm saying that suboptimal CPU cache utilization does not have a significant impact in 99% of software.
Anonymous No.106213833
>>106213650
>thinking objects are stored in memory as a whole
>it's another sub90 twp haver from north europe making the site worse for everyone else
every time
Anonymous No.106213940
>>106213528
>Having reading comprehension this shitty
I pity you.
Anonymous No.106213993 >>106214019
>>106208901
>everyone just treats it like cpp anyway by putting everything in structs and writing their own constructors and destructors and even using pointers to mimic virtual functions
>OOP code, in a language not primarily designed for OOP, is more comprehesoble and performs better
Anonymous No.106214019 >>106214078
>>106213993
that's the problem of the language if anything
>primarily designed for OOP
>C and classes superglued together is primarily designed for OOP
Anonymous No.106214077
>>106208779 (OP)
Anonymous No.106214078 >>106214093
>>106214019
That's the thing, C++ and it's sister languages like Java tend to borrow too much of syntax from C, that's why they fail at being good OOP tools
While I agree with OP, that good code is incompatible with OOP paradigm, it definitely has it's strengths
Python and Delphi are the perfect examples, they are easy to write working code with and are incredibly easy to debug
Anonymous No.106214093
>>106214078
Nobody cares about OOP in C++, OOP is absolute slop.
Anonymous No.106214136
you faggots need to define what you mean. you are talking past each other because you are using words that different people have different definitions of. probably because of jeets.
Anonymous No.106214213 >>106214456
i'm not a career coooooder but i dont get the hate for OO. i use powershell not infrequently and vastly prefer it to com/bash/etc because it returning objects I can pick attributes from (or being able to run commands against only certain attributes of objects i've picked) is incredibly handy
Anonymous No.106214414 >>106214466 >>106214555 >>106220829
>>106208841
>look at the code of large C projects
>filled with macros to replicate OOPisms
Anonymous No.106214456 >>106214901 >>106218991
>>106214213
People are too retarded to realize they can pick and choose which OOP features are useful for them and instead think some one-time-use component needs to be written like it's going to be part of the standard library
Anonymous No.106214466
>>106214414
>to replicate OOPisms
True, but that seems reasonable, as standard C is lacking functionality that would enable it to be OO-capable straight away, yet it greatly benefits in terms of coding speed (its major drawback) from emulating OO concepts
Anonymous No.106214555
>>106214414
This is literally every non-OOP language btw
Anonymous No.106214901
>>106214456
fair. i know a lot of the PS scripts I write are satanic, but I also know they're one-use and not meant to be extensible. I can see how the >NEED to maintain the OO charade in actual production code could annoy people when they just want to return one perishable interger
Anonymous No.106217535
>>106208779 (OP)
its trash
Anonymous No.106218028 >>106218116 >>106218220 >>106218331 >>106219388 >>106219975 >>106220559 >>106221124 >>106224155
>>106208779 (OP)
OOP is fucking annoying to deal with. I don't need another reason.
Anonymous No.106218116
>>106218028
Not an issue with CLOS.
Anonymous No.106218220
>>106218028
OOP users wouldn't claim that abomination on the left as OOP
Anonymous No.106218331
>>106218028
The right looks like javascript
Anonymous No.106218991
>>106214456
the standard library is pretty shit in most languages
Anonymous No.106219014
>>106208779 (OP)
Alright that's half decent bait.
Anonymous No.106219131
>>106209024
>she doesn't know L4 cache misses are by orders of magnitude the largest performance bottleneck in modern computing systems
Anonymous No.106219160
>>106209053
don't fight with microsoft managers, you wont win
Anonymous No.106219338
FP > OO.
It's that simple.
Anonymous No.106219388
>>106218028
>Leggable
Gets me every single time
Anonymous No.106219975 >>106221721 >>106222460
>>106218028
they will never admit that the logging framework is a dependency.
oh it's dependency injected so it doesn't hard link.
oh it's got if statements around every log statement which means that we don't actually need the logger to be there or not.
just because our code execution changes depending on if a dependency is there or not doesn't hecking mean that we have a dependency.
Anonymous No.106220559
>>106218028
>subhuman
>fleas: 14
Anonymous No.106220829 >>106221736
>>106214414
Don't know what shitty codebases you've been looking at.
Anonymous No.106221124 >>106221184 >>106224155
>>106218028
This. I ain't gonna traverse 10 layers of inheritance to find how a member is used.
Anonymous No.106221184
>>106221124
CLOS doesn't have this problem
Anonymous No.106221279 >>106221736
>>106208779 (OP)
Programs are best understood as logic flows, not a bunch of objects shitting out objects or objects shitting between other objects or shitting into other objects. With OOP instead of thinking more about how to efficiently control the logic of the program you think more about how to fit the problem you're trying to solve into the OOP framework.
Anonymous No.106221595
>>106208779 (OP)
Object orientation is too much wankery. The idea is to make programming retard-proof so the Indians can do the needful for pennies on the dollar while the glorious White Engineer from the North sends them the UML from his chaise lounge.

The only thing where it makes sense is Data, because it does make sense that a Data point is like an object, but then the gay and retarded hierarchy idea comes in with inheritance and it all just goes to shit. Structs are just better.

"Gee I gotta create the RequestHandler so it handles my request" statements by utterly deranged idiots. You are delusional if you think programming is about "defining the correct hierarchy of classes", which it's not.
Anonymous No.106221721
>>106219975
>they will never admit that the logging framework is a dependency
it's not a hard dependency because you depend on interfaces, not classes
dunno what you're trying to prove
Anonymous No.106221736 >>106221781
>>106220829
linux kernel?
essentially every C codebase since header/source files (classes) declare structs and methods that work on that structs. basic level OOP is just syntactic sugar around what you already do on C (structs, function pointers, etc.)
>>106221279
nocoder detected
Anonymous No.106221781 >>106221876
>>106221736
>essentially every C codebase since header/source files (classes) declare structs and methods that work on that structs
Data structures are not OOP. Shit turns into OOP when you start using retarded ideas like inheritance and encapsulation.
Anonymous No.106221876 >>106221947 >>106223231
>>106221781
>Data structures are not OOP
this board gets more retarded every day
Anonymous No.106221947
>>106221876
k
Anonymous No.106222165 >>106223231 >>106223312
>Data structures are not OOP
Anonymous No.106222460
>>106219975
>they will never admit that the logging framework is a dependency.
why not?
>it's dependency injected
>it's got if statements around every log statement which means that we don't actually need the logger to be there or not
that's not how log4j or other java logging frameworks are conventionally used
Anonymous No.106222494 >>106222509
>>106208779 (OP)
ffmpeg, sqlite
>>106208901
choosing C over C++ is no brainer if you want to make a library you want to be consumed from any language. You can write whole application in C++ and it might be less tedious and better for you, but if you write a library in C++ you are screwing up anyone else that doesn't use C++. While it's possible to use C++ library it's fucking annoying.
Anonymous No.106222505
>>106208779 (OP)
>why do retards hate OOP so much?
because it's far too easy to turn your clever idea for an Abstract Factory Mediator Memento into an untestable, unmaintainable pile of absolute garbage, when a simple module with a few basic functions would suffice.
Anonymous No.106222509
>>106222494
This.
Anonymous No.106222515
>>106208779 (OP)
Because you should favour composition over inheritance
Anonymous No.106223231
>>106221876
>>106222165
stay away from computers
Anonymous No.106223312
>>106222165
just kill yourself nocoder
Anonymous No.106223617
After reading this thread, I am now certain that OOP is just an IQ filter.
t. OOP masterrace
Anonymous No.106224155 >>106224322 >>106226547
>>106218028
>// !!!!Before Adding a new Animal, read the Readme.txt file in this Folder!!!!
>readme.txt
>To add a new Animal, you have to change the following Functions and add the new Animal to the If-Else-Statement in each Function:
>SetAnimalLegs
>SetAnimalFlees
>SetAnimalSound
>....
>HandleSpecialCaseAnimal
>>106221124
Let me guess, you non-no-coders are pro, and use Switch-Case instead of If-Else?
Anonymous No.106224282
>>106208779 (OP)
you can't leverage it to make invalid program states unrepresentable.
Anonymous No.106224322 >>106226476
>>106224155
>OOPshitters still haven't come up with a new example after 40 years
Oh yes I model different kinds of animals so often thank you object jesus I think I'll subclass rodent to implement a squirrel now
Anonymous No.106224336 >>106225143
>>106208779 (OP)
function pointers inside structs is superior in every way to the engineering clusterfuck that is OOP
Anonymous No.106225143 >>106225161
>>106224336
nah. it's a neat trick but it stops compiler optimizations.
Anonymous No.106225161
>>106225143
If your compiler sucks
Anonymous No.106225309 >>106226538
>>106208807
Alexander Stepanov is the largest contributor to the C++ STL by far and he hates OOP though.
Anonymous No.106226476
>>106224322
nocoder came up with the animal example. I jsut abstracted. Something your kin is unable to do.
Anonymous No.106226538 >>106227235
>>106225309
scott meyers has discussed this at length in his books and talks. the problem is the language wants a strict logical inheritance but programmers try to impose "colloquial" inheritance, like penguin deriving from a bird parent that has a fly method, or payment card number deriving from a number parent. madness that way goes
Anonymous No.106226547
>>106224155
>Let me guess, you non-no-coders are pro
Yes.
>and use Switch-Case instead of If-Else?
If appropriate.
Anonymous No.106226708
>>106212077
It has some good features.
Anonymous No.106227235 >>106227296
>>106226538
>the problem is
what's the solution
Anonymous No.106227296 >>106227549
>>106227235
inheritance is gay and wrong in like 99.9999% of cases. if you think you need it, you most likely don't. if there is one thing that the last 30 years of software dev has taught us, its "jeets, not even once" and very close behind that its "programmers cannot be trusted with the responsibility of a certain few language features"
Anonymous No.106227549 >>106227572
>>106227296
so your solution is to not use inheritance? lol
Anonymous No.106227572
>>106227549
yes. not out of blind obediance to some rule but because if you think through your problem you will realize that inheritance is almost never what you actually want
Anonymous No.106227684
>>106208779 (OP)
Because they've never worked with a large team on a large codebase.
>literally all good code is object based.
That's literally wrong though. It's one of the effective ways of arranging things when doing programming in the large, but not the only one. For some classes of problem, functional programming is a better option. For some big and actually important programs, none of that is needed and instead you just need utter numeric horsepower.
OOP love vs hate is just a dumb ignorant nerd slapfight. Smarter or wiser nerds avoid that idiocy. I guess you're still dumb and ignorant.