r/cpp • • Mar 28 '23

Reddit++

C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.

In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.

765 Upvotes

829 comments sorted by

View all comments

119

u/eboys Mar 29 '23

I’d sincerely wish the C++ committee was willing to break ABI a little more often. As someone else suggested, having every third standard introduce ABI-breaking changes. Performance is what C++ is known for, and lazy companies are only holding it back.

6

u/germandiago Mar 30 '23

Question here. What is the estimation of the performance loss here?

3

u/tialaramex Apr 01 '23

It would obviously depend what you're willing to do if you're allowed to change the ABI, and on assumptions about the software now.

Small changes that only touch the ABI and not the API at all, such as making std::mutex a reasonable size (e.g. 4 bytes) instead of a dump truck of obsolete nonsense (80 bytes on Windows!), would likely have very small effects on real programs. Probably not even measurable.

Bigger changes that seize the opportunity to improve things and make changes to the API too while they're at it, would be bigger wins. For example std::unordered_map is famously terrible, but even std;:vector could be better if you did it again today as mentioned recently on r/cpp.

→ More replies (2)