Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A usual programmer doesn’t need most features of C++ but there are many important:

Generic-programming with templates, a usable std::string, smart-pointers, references, the howl standard-library (streams, file access, containers, threads).

The controversial ones seem to be exceptions and classes. Exceptions affect programming flow, exception safety is very hard and the runtime costs are an issue depending on the environment. Class and inheritance are complicated feature, operator overloading is one of the best stuff I’ve seen. But I can understand why many programmers don’t want handle all the special rules involving classes.



This would add a lot of complexity into the C compiler and stdlib, and C would just end up as another C++. IMHO it is still important that a C compiler and stdlib can be written in reasonable time by an individual or small team.

And just one example (because it's one of my favourite topics where the C++ stdlib really failed):

std::string as a standard string type has so many (performance) problems that it is borderline useless. You can't simply use it anywhere without being very aware of the memory management implications (when and where does memory allocation and freeing happen - and std::string does its best to obscure such important details), and this isn't just an esoteric niche problem: https://groups.google.com/a/chromium.org/g/chromium-dev/c/EU...


Classes, which have constructors and destructors, simplify code immensely..so do copy and move constructors and operators.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: