4 ms·
"I agree it’s complicated, but that’s not necessarily a bad thing. You really don’t need to understand the whole thing to start using it. And when you’ve been u
by raverbashing 11y ago
"I agree it’s complicated, but that’s not necessarily a bad thing. You really don’t need to understand the whole thing to start using it. And when you’ve been using it for a while and start to understand the intricate details, it becomes very, very powerful."
To be honest, this is a corporate sales pitch. It's trying to justify the injustifiable
It doesn't need to be full of "features" that most people don't use. Granted, some of them are needed regardless
C++11 and 14 have simplified some parts, which is good. Still, a lot of other languages do more with less complexity
Some things that are painful
- String formatting in STL is a joke
- "Smart pointers" are still an add-on and clunky to use
- No reflection. Manual setup of getters/setters/copy constructors
- walkingolof 11y agoTo be event more honest, everything is complicated when you do not master it. C++ is a language with true benefits in terms of execution speed and flexibility, it may not just be the language for everything and everybody.
- raverbashing 11y agoYou can get most of the speed with C and it is not as complicated Flexibility should not imply in being "hard to use"
- walkingolof 11y agoThats an old sentiment that apparently never goes away, just like C++ is "hard to use", its only hard to use because you dont know what you are doing, when you are using C++ professionally you get to learn the language and appropriate patterns and after a while your perfectly comfortable, just like you would be with Java, Go, Haskell and Lisp.
- autoreleasepool 11y agoWhat's wrong with std::string though?
- raverbashing 11y agohttps://msdn.microsoft.com/en-us/library/hh438469.aspx https://msdn.microsoft.com/en-us/library/hh438469.aspx
- hellofunk 11y agoCompared to how strings are handled in many other languages or libraries, std::string is pretty limited. It works, though, and I use it. But when you have to do something basic like a trim, you find yourself wondering why it's not included.
- CyberDildonics 11y agohttps://github.com/imageworks/pystring https://github.com/imageworks/pystring
- roel_v 11y agoWhat isn't? Without boost::format and boost::algorithm, std::string is a major pain in the ass to work with. Even including those two, there's still the distinct lack of unicode-awareness (and no, wstring doesn't help, and neither does "let's pretend it's all utf8 underneath".) And then there is the institutional problem that nobody agrees on whether, and if so how, to use std::string in their libraries' API's. But on the bright side, string handling in C++ is not as painful today as it was in 2005, things do get better.
- nmeofthestate 11y agoI'd argue that a mutable by-value string type is not suited to most applications, hence why many other languages have avoided providing that style of string type as their core string type.
- hellofunk 11y agounique_ptr is easy, no overhead, and its friend, make_unique(), allows for concise generation of the smart pointer. what's clunky about that? (of course, make_unique didn't appear until C++14, so it was a bit more clunky before that).