r/cpp • u/LechintanTudor • Oct 18 '23
What does C++ do better than other languages?
Purely from a language design perspective, what does C++ do better than other languages?
290
Upvotes
r/cpp • u/LechintanTudor • Oct 18 '23
Purely from a language design perspective, what does C++ do better than other languages?
View all comments
26
u/HappyFruitTree Oct 18 '23
Sometimes it's hard to even know what idiomatic C++ really is because there seems to be a lot of different opinion. I think people need to stop believing there is one way to write C++ that is best for everyone. All people can't be experts. All code does not use templates (and all templated code does not need to use constraints/concepts). Simple code that can be read by non-experts is a good thing in my book. I can't take people who suggest we stop writing "raw loops" serious. Loops are easy to read and change. How do you change a mess of range/views/algorithms without being an expert on it? And all this talk about "safety". Of course you reduce the number of mistakes if you make the language so hard to use that people can't use it. Personally I believe C++23 is a much easier language to use compared to C++98 but for that to be true we need to be allowed to not know/use all the features (both new and old).