-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style: Indent level in switch blocks #227
Comments
Variant A is better due to how many nested switch statements are in the code. The alternative would be to have the deepest indent in large essential functions be 3-4 indents deeper than they would have been sticking with variant A, which makes the code less readable. Then for consistency we should keep the rest of the code on the same style. |
I have made several PRs converting style A into style B, which have been approved and merged, and during original style guide discussions, we did decided on style B, so imo style B is better, plus, I prefer it because I personally find it much easier to read |
I prefer style B. |
Style A reinforces the fact that the case labels have no scoping significance and have about the same effect as a |
I abstain from this discussion. |
There is actually a third variant C: case labels indented by 1, but case contents not indented.
I only mention this because this is the default in Notepad++. With that, I want to mention that editors are inconsistent as to which style they automatically indent to:
|
objectively bad |
It's like the worst of both worlds |
I prefer style B. |
This issue has had no activity for 60 days and will be marked stale. If there is no further activity, it will be closed in 30 days. |
This issue has had no activity for 60 days and will be marked stale. If there is no further activity, it will be closed in 30 days. |
This issue has had no activity for 90 days and will now be closed. |
Variant A: Case labels flush with the switch statement. This is the standard in pret/pokeruby etc.
Variant B: Case labels indented by 1.
The text was updated successfully, but these errors were encountered: