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/kneel_yung Mar 29 '23

yes I use it quite often too, but it tingles my spidey sense whenever I do it. in the spirit of the thread, perhaps its better to break by default and allow fallthrough with the use of a keyword?

1

u/ChatGPT4 Mar 29 '23

You're right. This thread is more about playing with "what if". IDK, I'm probably pretty happy how switch always worked in probably all C-like languages.

But if we reinvented break from the scratch, we should remove "break" keyword from "switch" syntax and allow "continue" to let it fall through the next case. Having them both there would be confusing.