[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1755592801061405.png (1.14 MB, 1000x665)
1.14 MB
1.14 MB PNG
If OOP is so bad, then why does everyone still use it for everything?
OOP and modern software are synonymous.
>>
yes, because anything that is popular and mainstream can't be bad. python for example is a fantastic language for serious programmers
>>
>>108234442
But... it is?

Python is god-tier for anything that isn't performance-heavy.
>>
>>108234445
that's why it's widely used everywhere!
need something faster? just use rust!
>>
>>108234450
I can't tell if you're serious or not.
OOP and Python are good for creating boilerplate-light and non-verbose code.
>>
Autists can only think in singular objects, that's why. That's also why modern software sucks - because it's not written for the hardware in question, but for the mental model of those who should've never been allowed into the profession in the first place.
>>
>>108234485
OOP mental gymnastics,
>A car is an object made out of steel, a license plate and seats that moves.

ECS mental gymnastics,
>something has a transform component
>something has a velocity component
>something has a steel framework component
>something has a seat component
>something has a license plate component
>a car? what the fuck is that?
>>
>>108234407
OOP is POO in Spanish

That's why. It's specifically designed for POOjeets.
>>
>>108234507
Thanks for proving my point.
>>
>>108234518
I don't have autism, so I guess that proves MY point?
Ask a normie whether they find OOP or ECS more intuitive and they'll say OOP every time.
Steve Jobs famously credited OOP as a revolution in programming that made development 5 times faster.
>>
>>108234534
>I don't have autism
You should get a second or even third opinion then. Every non-autistic programmer would know about SIMD instructions and how operating on singular objects yields garbage code.
>>
>>108234534
Oh, also:
>that made development 5 times faster
Fast forward thirty years, at the end of Moore's Law, and we're looking at unmaintainable software and such fucked-up memory management that you need constructors and destructors.

If you prefer that, then you deserve the current programming landscape.
>>
>>108234457
>OOP and Python are good for creating boilerplate-light and non-verbose code.
bait or mental retardation. call it
>>
>>108234407
Okay, I will tell you why.

Back in the 90's, Shekelstein saw that the Internet was getting fast.

"Oyvey", he said, "we can hire Pajeets for a FRACTION of the cost of an American and they can do the job just as well; Glory to the state of Israel!"

But then Shekelstein realized "SHIT! Pajeets are fucking DUMBFUCKS! They are afraid of pointers!"

"I know!", Shekelstein said, "I will design a language where everything has to be modeled like a concrete object because Pajeet doesn't have reasoning skills beyond a K9 American! That way, we can have a White GOY from the North design the whole software as a "Class Hierarchy" so he gets his rocks off about racial superiority, ship it off over the Internet to the Pajeets who can manufacture it for ultrapennies on the dollar, then send it to us. Brilliant!", Shekelstein said while laughing his way to the bank.

That's why Object Orientation exists.
>>
a=:1.2.3_+4.5.6;

so much fun.
>>
File: socks.jpg (49 KB, 640x480)
49 KB
49 KB JPG
>>108234407
>If OOP is so bad, then why does everyone still use it for everything?
One of the things that make it bad is the way its proponents have failed to define a concrete and feasible design methodology, so they've reverted to "if you have functions that do things on structs, you're using OOP".
>>
>>108234507
>top
The way street shitters think car manufacturers think about cars
>bottom
The way car manufacturers think about cars.
>>
>>108234407
>screwdriver is a great tool we need to use it on everything
this is how retarded people think
>>
>>108234507
that's exactly the issue, you're not describing a car to a person, you're describing it to a computer, self proclaimed programmers will insist that its better to make computers think like us instead of programming them in a way that works better for them.
>>
>>108234688
Neither representation of a car "works better" for a computer
>>
>>108234705
>he doesn't know how processors work
>>
>>108234712
Processors don't understand objects or components, nothing in that post has anything to do with how it is represented to a computer and everything to do with how it is represented to a human
>>
>>108234720
do you even know anything at all about ECS? or are you just here to shitpost?
>>
>>108234688
>>
>>108234720
Holy shit, go read Agner Fog's PDF about optimizing assembly.
>>
>>108234705
if you have a million different cars with a bunch of properties of different sizes that are used in different places, it's better to store them by property than by the entire object. So you don't have to load the car plate, wheel radius, engine model, gasoline tank, owner, number of seats, color and weight when you just want to change the X and Y position of every car.
>>
>>108234735
>do you even know anything at all about ECS?
Yes

>>108234739
>if you have a million different cars with a bunch of properties of different sizes that are used in different places, it's better to store them by property than by the entire object.
That depends entirely on the access pattern
>>
>>108234749
>That depends entirely on the access pattern
Yeah, the access pattern is "bunch of read-only data with some read-write data in it". There is no reason to mix the two.
>>
>>108234762
No it depends what fields your procedure is accessing
If you're sorting cars and you need to look at every field, it's better to have an array of structs
If you're just changing a single field, it's better to have a struct of arrays
You can't generalize and say one is always better than the other
>>
>>108234407
>>108234442
You people will make console wars out of anything
You're literally unemployed
>>
>>108234769
>If you're just changing a single field
Yeah, because you only ever change a single field. Because that's how things work.
>>
>>108234776
Is that sarcasm?
>>
>>108234779
Couldn't possibly.
>>
>>108234485
>Autists can only think in singular objects, that's why.
ah, the cnile cope of the month repeated yet again

>That's also why modern software sucks - because it's not written for the hardware in question, but for the mental model of those who should've never been allowed into the profession in the first place.
the real problem is that cniles are incapable of any abstract thought, thus they can't solve any real problems beyond some simple, low-level stuff; while functards are stuck in useless academic wankery and can't solve any practical problem whatsoever.
>>
>>108234782
Some procedures operate on one or a few fields and are better for SoA
Some procedures operate on more fields and are better for AoS
Saying you only ever do one or the other just demonstrates complete and utter ignorance of programming, if you think you only ever do update operations on individual fields I assume the only programming you've ever done is simple database queries
>>
>>108234553
>we're looking at unmaintainable software
legacy OOP codebases, no matter how dire their state, are still leagues more maintainable than any comparable procedural cnile codebase
though this assumes the codebase is actually object-oriented and not just written in an OOP language but with a procedural approach

>and such fucked-up memory management that you need constructors and destructors.
Java does not have this problem
>>
>>108234749
in one situation you have all the X and Y positions stored side by side, in the other you have all the information about the car side by side, and if you just need one property you need to load everything in together. Sure, it depends on what you're doing, maybe you need all the properties, so it makes sense to group them together, but making an object and sticking everything in there regardless of its being used or not it will be a lot less efficient.
>>
>ITT: low IQ people with no capacity for abstract thought "argue" about slogans and ideologies.
You realize there's nothing stopping you from storing entity components in arrays, for the benefit of processing that only cares about those components, but also mapping elements from different arrays into bundles, for the benefit of entity-level logic... right, anon?
>>
>>108234623
>its proponents have failed to define a concrete and feasible design methodology, so they've reverted to "if you have functions that do things on structs, you're using OOP".
never seen actual OOP proponents use that definition. if anything, it's either opponents or people neutral to OOP that use that line of reasoning, usually as a strawman for blaming OOP for non-inherent problems
>>
>>108234802
I'd say for general purpose programming most of the time you're dealing with several fields at once so objects / AoS are a sane default and you can change your program to SoA if you need more performance
SoA is generally more constrained and harder to work with too
>>
It's bad because of the risk of over-abstraction and the fact that biding data to functions reduces code reuse.
Your shitty Cnile scripts are still much worse than any good OOP code.
>>
File: Inheritance.png (38 KB, 680x774)
38 KB
38 KB PNG
>>108234507
top
>>
>>108234813
>never seen actual OOP proponents use that definition
That's because you're 70 IQ. OP does that. You probably agree with OP.
>>
File: Interfaces.png (16 KB, 528x218)
16 KB
16 KB PNG
>>108234507
bottom
java does both
>>
>>108234833
>IQ projection
ok Ramesh
>>
>>108234847
he's right though, you either didn't read the OP or you lack basic reading comprehension
>>
>>108234969
point out what I've miscomprehended
>>
>>108234829
>It's bad because of the risk of over-abstraction
you can refactor and un-abstract code

>biding data to functions reduces code reuse
you're meant to bind state and behavior, not data
data is just what your program processes during runtime
>>
File: poo-pillars.jpg (43 KB, 1142x742)
43 KB
43 KB JPG
>>108235041
do you think op is anti-oop? because he's clearly doing the "oop = structs+functions" routine. everyone clearly does not use pic related for everything
>>
File: images (29).jpg (16 KB, 447x447)
16 KB
16 KB JPG
>he hasn't taken the FPpill yet
>>
>>108235178
>do you think op is anti-oop?
feel free to point out where my post relates to OP directly and not a reply to it
also, you ask this only after you've already made your assertion but got called out on it?

>because he's clearly doing the "oop = structs+functions" routine
how did you get this conclusion just from OP's post?
>>
>>108234813
>if you have functions that do things on structs, you're using OOP
are they wrong?
>>
>>108236426
you can use "functions that do things on structs" to describe typical C code
is C OOP?
>>
>>108236926
i guess what I am asking is: am I using OOP if I use classes? because they're fundamentally the same thing as using functions to manipulate structs in C.
>>
>>108234407
They know that OOP was not ideal for all software programs back then.

>A major contribution to structured programming was made by David Parnas in 1972 with the concept of information hiding, and at the same time by Barbara Liskov with the concept of abstract data types. Both concepts embody the notion of breaking up large systems into parts called modules, and clearly defining their interfaces. If module A uses (or imports) module B, then A is called a client of B. The designer of A then need not know the details, the functioning of B, but only the properties as stated by its interface.

>As the demand for ever more complex software persistently grew, and as the difficulties became more menacing, illustrated by some spectacular failures (of which the most conspicuous was the crash of a rocket that abruptly ended a space mission), the search for panaceas began. Many cures were offered, sold, and soon forgotten. One of them, however, proved fruitful and has survived: object-oriented programming (OO).

>[...] A discrete-event system consists of actors (processes) that come and go, that pass phases in their lifetime, and that carry a set of private data representing their current state. It proved natural to think of such actors with state as a unit, as an object.
Some programming languages were designed on the basis of this model, their ancestor being Ole-Johan Dahl and Kristen Nygaard’s Simula in 1965. But such languages remained confined to the field of simulation of discrete-event systems. Only after the emergence of powerful personal computers did the OO model gain wider acceptance.

>Object orientation became both a trend and a buzzword. Indeed, choosing the right model for an application is important. Nevertheless, OO is not appropriate for all applications.
>>
>>108234407
why do you continue to buy the shitty products you keep complaining about?
enterprise software is OOP because it inflates the price and lets you throw buzzwords at clueless investors, that's all it is.
>>
>>108234534
and software 50 times worse, but next gen hardware will fix it.
>>
>>108237005
just putting something inside a class doesn't make it OOP

>they're fundamentally the same thing as using functions to manipulate structs in C
classes do not define behavior like functions do
>>
>>108237483
... *but it never has*.
>>
>>108237483
>and software 50 times worse, but next gen hardware will fix it.
You can blame Alan Kay for this, but not because of OOP. He specifically promoted the concept that many developers live by:
>He believed that by investing in future hardware capabilities, even if they weren’t yet available, teams could design and test software as if it were already running on that advanced system. This allowed developers to create applications and systems that were ten years ahead of their time, without being constrained by current limitations.
Every developer who goes out and buys a top spec M5 to code on is making unusably slow software... because it only works on top spec hardware. Conversely every freetard still developing linux kernel on a 2008 C2D is out there blocking this sort of shit and keeping FOSS fast. It's possible to write a performant cross platform Java Swing app these days, but fags carrying MacBooks are going to ship shit in Electron anyway.
>>
>>108234485
Kek FPoids truly believe that files full of static function Defs are different to classes full of static and stateful members.

If you're following proper FP practices the memory consumption is significantly higher and if you're not following proper FP practices and you're mutating m you're just writing classes with extra steps
>>
>>108234485
It's more accurate to say different people have different mental models for things. People debating the merits of OOP and ECS are ignoring that elephant in the room. It's like forcing a left handed person to be right handed and vice versa.
>>
File: buga-sphere-00.jpg (1.45 MB, 1280x2049)
1.45 MB
1.45 MB JPG
>>108234407
Skill issue. Most retards out there are completely unable to use a tool the right way and then they blame the tool. They are so stupid they try to use a hammer as a saw.
>>
>>108239977
>files full of static function Defs are different to classes full of static and stateful members
Surely you have assembly output to back up your claims?
>>
>>108234407
oop is bad because thats the sound you make when you fuck up
>>
who says its bad? that retard in red shirt?

ECS can be designed inside of OOP, they dont replace each other
>>
>>108235305
>seething so badly your brown mind filters parts of the post you don't want to see
i accept your concession
>>
File: redditbrained.png (116 KB, 573x597)
116 KB
116 KB PNG
>>108237005
>am I using OOP if I use classes? because they're fundamentally the same thing as using functions to manipulate structs in C.
by the "everything is OOP" cult logic, yes

>>108237893
>heckin' syntax sugar makes it OOP if they keyword uses the right combination of ASCII characters
i see that you conceded to another poster as well. i will continue to use """classes""" in languages that want me to use them but i will never write a single line of OOP no matter how much your cult wants to call my code "OOP"
>>
>ad hominem
>>
>>108243193
please provide an example of oop and non oop using classes which includes fields and functions manipulating those fields.
>>
>>108234507
the ECS example sounds a lot better though.
>>
>>108234457
Anything good in python was written in C, C++ or Fortran. If anything would be written fully in python it would be garbage. It's the only reason Python is what it is. Without that Ruby would win for non-performance stuff, because it is actually a good language. Python is poo.
>>
>>108234553
>need constructors and destructors
Has to be ragebait. You want to tell me youre writing serious, versatile software with abstractions that dont need automatic lifetime management? Constructors and destructors are a natural abstraction you arrive at after trying to do something complicated in C.
>>108234485
Ironic since after speaking to actual employed game engine devs all of them say ECS is dogshit and nobody in industry implements them for a reason.
>>108234799
Based

I feel like almost everyone in this thread has never actually worked on a runtime and are just regurgitating memes to support some creator they like.
>>
>>108244771
>Anything good in python was written in C, C++ or Fortran.
Uhh sure, but we're not dick-measuring for whose daddy is whose, this is about using paradigms and languages to ship products.
>>
>>108244819
>Has to be ragebait.
You're still at stage n.
https://www.youtube.com/watch?v=xt1KNDmOYqA
>>
>>108244858
>Posts link to meme youtuber
Like clockwork.
>>
>>108244819
>durrrr my uncle works at nintendo and he said ECS is shit and no one uses it!

Meanwhile,
>Overwatch
>Minecraft
>Dead Rising
>System Shock
>Thief
>>
>>108244885
>doesn't have a counterargument
I accept your surrender, autist. In a proper society you'd already be in a cage.
>>
>>108244885
>Industry veteran talking = meme youtuber
OOPs...
>>
>>108244889
Thief = not technically impressive
Minecraft = infamously shit and tanhled codebase both in Java and especially in the C++ rewrite

Considering ECS is meant to be performant none of the titles you've listed are particularly technically impressive.

>>108244898
Neither do you, in fact you never had a point.
>>
>>108244936
>implying the opinion of an autist matters
Fascinating. Now enter the cage.
>>
File: 1755275877806554.png (212 KB, 544x484)
212 KB
212 KB PNG
>>108244936
>technically impressive
Goalpost status: MOVED

Also, you still have no argument.
>>
>>108234442
Terrible example. Should have used PHP
>>
Because it isn't bad.
>>
>>108244904
what software did he complete in the last 15 years?
>>
>>108245184
>Pretty
>Huge
>Penis
Yeah I love PHP
>>
>>108245218
das gay
>>
It's not that it's bad, OP, it's the misuse of it that makes people advise against it. Creating a banana shouldn't spawn a whole jungle and the monkey holding it
Objective C and the Foundation libraries are a great example of good OOP
>>
>>108244008
A good Non-OOP example is Haskell and their type classes
https://www.haskell.org/tutorial/moretypes.html



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.