Follow

@sir Very nice guide! But could you expand on the reasoning behind this rule?
> MUST align case branches with the switch statement.
I'm assuming it has got to do with the 80 cols limit. I normally indent the case statements too, as it's visually easier to jump pass the entire switch statement.

@p two indents for one section of control flow is not great, and it helps with the 80 col limit yet

@sir never really thought of it in terms of a single control flow section. And then it makes sense to me to be thinking of the case directives more as labels, which aren't further indented.
Thank you for the clarification.

Speaking of labels, the guide doesn't state indention rules for labels. I believe it's pretty standard to have them unindented. But I have seen cases where they were. Perhaps the guide should spell it out?

@p they should be unindented but you should also be using them rarely enough that it doesn't need to be called out in the style guide

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml