Sujet : Re: Which code style do you prefer the most?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 27. Feb 2025, 02:08:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vpodu9$2q6ak$5@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.162 (Pokrosvk)
On Wed, 26 Feb 2025 17:51:19 +0600, Ar Rakin wrote:
I like the GNU style except the weird indentation before the braces of
control statements. Not sure why they choose to indent that way.
Just to add to that, I like to *outdent* my “break;” statements at the
ends of case alternatives:
switch (TheEvent.type)
{
case Expose:
fprintf(stderr, "Expose received\n"); /* debug */
MainWindowVisible = true;
/* no drawing done here: just wait until time for next animation frame */
break;
case UnmapNotify:
MainWindowVisible = false; /* I've been iconified */
break;
case VisibilityNotify:
MainWindowVisible = TheEvent.xvisibility.state != VisibilityFullyObscured;
break;
case DestroyNotify:
fprintf(stderr, "Window destroyed\n");
Quitting = true;
break;
default:
fprintf(stderr, "got event type %d\n", TheEvent.type); /* debug */
break;
} /*switch*/
Can anyone guess why? ;)