Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

break and fallthrough

23 views
Skip to first unread message

Andrey Karpov

unread,
Jan 27, 2018, 7:44:49 AM1/27/18
to
We would like to suggest reading the series of articles dedicated to the recommendations on writing code of high quality using the examples of errors found in the Chromium project. This is the second part, which will be devoted to the switch operator and, more precisely, to the problem of a forgotten break operator.

For many years I have been studying errors in programs and now I can say for sure that in C and C++ the switch operator is implemented incorrectly. I understand that the possibility not to write break, made to pass control further, allows writing elegant algorithms. But still a great number of errors convinced me that the wrong approach was chosen. Sure, it is too late now. I just wanted to say that the right decision would be to necessarily write the word break or a reverse keyword, for example, fallthrough. It would have saved so much effort, time and money. Of course, this shortcoming can not be compared with Null References: The Billion Dollar Mistake, but is still a big blooper.

Continue read: https://www.viva64.com/en/b/0554/
0 new messages