isocpp / isocpp/CppCoreGuidelines
rename ES.70 to ES.77 and add breaks to the example.
Open
@neilmacintosh is already working on this.
Since Oct 10, 2016.
open
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
ES.70: Prefer a switch-statement to an if-statement when there is a choice:
The example is misses break; between every case this means that it cannot be compared to the if else example. since it will use a fall through
The next 7 Paragraphs talk about loops and goto and then back to switch, moving ES 70 to 77 will make the switch rules grouped together.
I also have a small curiosity what are the rules of a duff device? i.e. mixing a loop and switch case, should this be avoided at all cost, e.g. scream and pull hair out?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.