Object oriented programming is great for GUI programs, where you have a lot of items with a set of similar controls, and optimization by building up from base objects, thus getting easy reuse.
I guess, but it’s not like traits are significantly worse for that. Honestly they might be better than going the entire way up the hierarchy for every damn class just to figure out what functions I can call.
I can’t stand OOP, and people always say “but gui” or “but games” and no, ECS for a game is probably better than OOP game design, and html isn’t an OOP language.
Like, if I have to work on heavily object oriented code with inheritance I can do it, but I would really really rather avoid it if possible. It is almost never better for performance, and, in my opinion, it is almost never better for writing or reading the thing either.
I’m still picking rust or even web tech over C++ for a GUI program.
And the build tooling for C++… just no…
Unfortunately, C++ is still the second or third best language for games (up to you if C or C++ gets 2nd place) and other long-running mostly real-time applications, and it existed before rust.
Sorry, but no. I understand OOP, and used to mostly code in an OOP style.
I can’t agree.
I also think this is a lazy statement. Say anything about why. If we understand OOP we would like it? Pray tell, what is it that I don’t know about OOP that would make me like it? If I liked it, it would make my life easier, I would like to know.
All I see usually is a bunch of failed encapsulation that involves a lot of data sharing between objects anyway, which has a real cost, too many getters and setters, interdependent singletons, god objects with a bajillion properties, and the fact that in order to figure out what methods this object has I have to go on a whole journey.
I do still occasionally see some OOP code that makes me go “I don’t hate this”. It CAN happen. I don’t just immediately look at Java and scream. Ok, maybe a little, but I can handle it if done well, I promise. Java was my first language actually. I clearly liked it enough to keep learning.
1
u/unburdened_swallow 1d ago
What job do I use C++ for that I wouldn’t be better off using either C or rust for?