Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Yeah, the STL is massive and the general workflow gives the impression that C and high abstraction don't mix well.
-
Because I like using a
std::vector<std::map<std::pair<std::string, std::deque<std::string> >, std::list<std::vector<int> > > >
data structure unironically :p
And it's actually so damn satisfying to slap a ::iterator in front of that horror and have it work because STL is so damn well designed.
Curious where you're having to use std::bind though. -
@RememberMe I'd say std::bind is pretty normal when you want to pass a callback but discard the result, or add placeholders to some params that your callback uses. It can save you a whole connector function. But only if neither the callback, nor the host are from a C api, because those don't work with std::callable or whatever the interface is called.
-
Because devs were underused and bored in the project so that they made it more challenging by introducing a lot of garbage. Incidentally, that's also how C++ arose in the first place.
-
Hazarth94764yI Agree with @Lor-inc
std::bind and the whole <functional> really make C++ more usable these days. Its easier to use bind than to pass around bunch of function pointers or designing a custom interface for this
std::move can also bypass some ugly memory logic so the code looks neater
std::tulple is more of a convinience, if you know what touples are then its also more readable than structs or custom classes
I don't think I ever used ::tie!
One really cool one is std::variant, which is just a fancier and safer union.
But I get what you're saying. C++ has become heavily experience oriented and It's almost impossible to read or debug unknown code without the docs handy. I don't necessarily think that's a bad thing though, all those std:: functions are not needed, but once you know them, they can reduce the amount of boilerplate dramatically -
You're jonesing for first order intermediary encapsulation and some logical destructuring assignments, but you're in C++ so you do what you can.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
Rant C++
Why do some people like to use ALL the language features. lets use "auto" en "std::tuple" and "std::tie" to hook everything together.. I cannot put something In a list because I now have to use std::move. SURE! If for every line of code I need to lookup what things were again or fixing compile errors it breaks my flow. "std::bind" this and Template that. half of the stuff you don't actually need.. it just complicates things..
Not all are bad. Only Unnecessary sometimes.
rant
c++
cpp14
code cpp11