isocpp / isocpp/CppCoreGuidelines

rename ES.70 to ES.77 and add breaks to the example.

Open
#574 2 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.