5 ms·
C++11 in no way solves the fundamental problem of C++. C++ is too big and has too much baggage. There are too many corner cases and oddball stuff to deal with.
by jernfrost 11y ago
C++11 in no way solves the fundamental problem of C++. C++ is too big and has too much baggage. There are too many corner cases and oddball stuff to deal with. Being a good C++ developer requires unnecessary amounts of training.
C++11 can't remove what is already there and so one just keeps piling on more stuff increasing the complexity.
I am actually sad C++11 happened because it keeps alive a language that should have died years ago.
I've worked years on projects where so many of the fundamental problems can be traced back to the usage of C++. Huge amount of legacy code which can't safely be refactored because C++ is just too complex a language for a refactoring tool to be able to deal with properly. Insane compile times. Odd hard to track down problems from static initialization and deinitialization. Templates are impossible to use in a sane way because they mix so poorly with regular OOP in C++ and increase compile times too much to be practical.
Move a project like that gradually away from C++ is a huge undertaking and nobody is going to support it as long as C++ keeps updating self to not be completely behind the times.
- hellofunk 11y ago>There are too many corner cases and oddball stuff to deal with. It seems like all the langauges I've used, from objective-c to swift and Clojure require you to keep certain aspects of the language in mind for certain situations that don't on the surface seem obvious. Purity in any language is quite rare. In the case of C++, it is possible to ignore much of that old baggage most or maybe even all of the time if you write new code using new features. I agree that those maintaining much older codebases are going to have a rough time, but is not an uncommon problem in many languages. Also, even in a so-called "better" language you can run into massive refactoring projects with older code once you choose to adopt new libraries and tools. As Bjarne says, C++11 is much better, C++14 will be even better, and C++17 is further going to be better... frankly, this is a good path for any language to be on.
- gbersac 11y agoThere is much more weird stuff in c++ than in any other language. Especially rust. Add to that that you also have to deal with the Makefile/Cmake garbage. Another solved by rust (rust is shipped with cargo which release you of the makefile hell).
- jernfrost 11y agoI don't think purity is the problem. I just think simplicity has value. It makes it possible to keep most of a language in your head. It makes it possible for anybody on your team to have a chance of understanding your code. There was a time I tried to embrace modern C++. Problem is C++ is so big that there will always be lots of people who don't understand the code you are writing. I used to have tech talks to explain concepts like C++ concepts, models and how it relates to STL containers, iterators etc. But ultimately all these efforts is just putting bandaid on a shitty language. The whole point of programming languages is so people can exchange code and understand each others code. C++ is epic fail in this area. While Objective-C is also a kind of old and crufty language, it is infinitely simpler than C++. Maintaining old codebases in anything other than C++ is much simpler for many reasons. Refactoring tools in languages like Java and C# actually works. Refactoring in Ruby or Python is simpler because they more naturally decouple due to their dynamic typing. Refactoring C++ code is hell on earth because the refactoring tool has to be able to understand macros, C++ templates etc. Any changes to a class interface even private methods or variables requires recompile of all files using that class. Which means doing lots of changes means recompile of lots of files. Which sucks in a large project when C++ is terribly slow at compilation to begin with. Compare with a language like Go. The syntax is so much more sane that you can actually write simple refactoring tools yourself easily. No way in hell you can do that with C++. No matter what Bjarne does with C++, they will still be stuck with macros, a fiendishly complicated template system, static initialization and deinitialization mess. As long as you need to remain backwards compatible you are stuck with a lot of awful stuff.
- hellofunk 11y ago>But ultimately all these efforts is just putting bandaid on a shitty language. Well, that's a highly subjective opinion. It sounds like C++ doesn't work for you but I still find it a fascinating and enjoyable language to work in. There are drawbacks with any language, and I guess the drawbacks you find for yourself in C++ are your business.
- alexeiz 11y agoThe main reason C++ is still in use is not the zillions lines of existing code. It's the lack of alternative. Other languages may excel in one or two areas, but if you consider the whole ecosystem, C++ is still the best. The availability of highest quality compilers for all possible architectures, build tools, IDEs, static analysis tools, profilers, libraries - all of these factors combined make C++ the first choice for many applications. C++11/14 didn't just "happen." A lot of smart and highly paid people invested their time and expertise to make it happen. Were there a better alternative to C++, they would invest in that alternative rather than putting their time and effort into C++. It's also great to see new ideas being borrowed from other languages and applied to C++. It shows that C++ is not a niche language some people like to view it.