Objects in C++ feel like they exists to make things needlessly complicated. Am I wrong?
Objects in C++ feel like they exists to make things needlessly complicated. Am I wrong?
Other urls found in this thread:
It's you who's making them complicated.
Just because a particular feature exists in C++ doesn't mean you have to use it.
Are you saying "using objects complicates things" or "you are making your objects complicated"?
when you attempt to make something more than fixxbutts or hello world you'll find them to be useful
Absolutely this. Having containers with simple interfaces for objects that are much more complicated behind the scenes is a huge help when trying to maintain/debug things.
No, you're not. OOP is the biggest meme in the industry, and everybody drinks the koolaid.
Go's flat interfaces make me hard.
What if your writing a video game?
>What if your writing is a video game?
What?
The only hard thing about C++ is template metaprogramming and deciphering the compiler errors you get when you fuck something up.
Sure, most games these days are written in C++ but they could equally be written without using OOP. Straight C used to be the norm, although to be fair a lot of games were written in what was basically poor man's OOP implemented in C. (See quake1-3, for e.g.)
>let me make 500 variables for a gaming character and functions to go along with them instead of just using a object
Not sure what your point is. Study quakes 1-3, doom, etc., it's not as bad as you think. Besides, OOP doesn't change the number of variables or methods you're working with, if anything it increases them because you end up writing more boilerplate that doesn't serve to solve the problem at hand.
Yes.
Worst case, you are using a single instance of a class to encapsulate something.
There you still have something that happens when you start of close them and all functions you can do to that thing is under that object name.
It is also very good for documentation.
Say you write a pose class.
It is just an x and y and theta when you begin, but as things start to demand it you make a few functions to that class like allow multiplication, addition and subtraction, comparison and printing.
Then you make path that uses this pose.
This path would be a container that let people loop through the poses, but you might as well have some functions to get the length of the path and stuff like that.
Then you make a class to calculate a path and a class which could follow the path.
All these things could happen by just knowing how the interface should be.
You can make 10 different people work on 10 different objects and as long as the interfaces work and the function is correct then it could be tied together.
Obviously it all breaks down if someone makes something that doesn't work, but that is more a problem of bad programmers.
There is no conflicts in variable names, no conflicts in function names and everything is so easy to document it probably is.
>2016
>Not using assembly
we all use assembly in some way
>he posts on g
>he writes non-portable code
When you don't have oop, you usually focus on the functions first. You write functions that do something instead of objects that have a behavior.
C++ is a garbage language and while every new version tries to make it better it will always stay shit.
youtube.com
(pic related is a meme, not real)
No one uses OOP anymore. It's all about generics now.
>(pic related is a meme, not real)
You don't say
not everything that sounds ridiculous is hoax.
And every time that pic is posted there's always someone asking "Is this real?!?"
You just can't win in this place.
This is why people do not construct their code this way.
Sure it sucks that you have to make workarounds for your library, but this is only relevant for people who make libraries which will be compiled on 98, 11 and 14 compilers.
His expansion of the constructor would also make him expand his functions if people had a 7d vector they wanted to cross product.
So the problem is really his structure.
Either make one class for each template as they will behave differently in so many situations or write the extra stuff in his class that he bitched about.
Copying lines is one the easiest thing a text editor can do.
>t. Unemployed
I'm aware of the UK government using Go but not of C++ anymore.
he's saying when YOU use objects and it makes it complicated for YOU YOU make it complicated
>the UK government