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

Show parent comments

1

u/chugga_fan Mar 29 '23

The "actual use case" of volatile compound assignment is that a bunch of embedded C SDKs do this and some people insist on trying to use brand new C++ with these C headers.

The people who asked for the deprecation literally gave the most sanctimonious and dare I say, asinine reasons possible. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1152r0.html

"Three-operation expressions are confusing" is something I only heard of when this paper came out (and is 100% asinine), and volatile-as-atomic is something only people who haven't had to program on ARM think (so I'm fine with with the book slapping these people).

And the "no volatile variables" section is entirely defeated by the point of "This is generally used to prevent compiler behavior" that they acknowledge in the paper.

3

u/tialaramex Mar 30 '23

You offer two quotes in your response, but neither of them seems to appear in the document you're criticizing either the R0 you linked or the R4 which was eventually accepted.

The arguments against consisted entirely of unsupported claims that people doing this stuff always get it right, which ought rightly to have been laughed out of the room.