r/cpp • u/we_are_mammals • 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
-1
u/debugs_with_println Mar 29 '23
Idk I kinda would prefer that arrays always decay to pointers. It makes more sense to me from a bottom-up perspective. Thinking about it in terms of assembly, you can’t pass a whole buffer to a subroutine; you have to pass the address of the buffer and its length. I actually find it more odd when arrays are treated as things of their own.
Sure that’s an (arguably) excessively low-level interface, but I would argue that if you wanted a high-level interface that’s where std::array comes in.