Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Thu, 27 Feb 2025 01:08:26 -0000 (UTC) Organization: A noiseless patient Spider Lines: 31 Message-ID: References: <20250225104754.267@kylheku.com> <878qps2abs.fsf@onesoftnet.eu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 27 Feb 2025 02:08:26 +0100 (CET) Injection-Info: dont-email.me; posting-host="5663112188f1f002c68c712720ef74d4"; logging-data="2955604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TdpzLDxghpTdjIEPOS7jo" User-Agent: Pan/0.162 (Pokrosvk) Cancel-Lock: sha1:tAFLlFe4NxG0HSKFhrzI+Em6oYk= Bytes: 2122 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? ;)