Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Readability (was: "...the value becomes,indeterminate each time the declaration is reached") Date: Thu, 21 Mar 2019 23:25:01 -0700 Organization: A noiseless patient Spider Lines: 39 Message-ID: <86o963o282.fsf@mailhub.linuxsc.com> References: <20190201132441.0b099e5f38fdb72371bc44f0@g{oogle}mail.com> <868sy3cdbp.fsf@mailhub.linuxsc.com> <87imx61vq7.fsf@bsb.me.uk> <867edatrn3.fsf@mailhub.linuxsc.com> <87r2b0xyy4.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="12002fc6e8015032ba78a259e24530e4"; logging-data="26273"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+xaiOGgb55zxXQoDy7l7nu1JfRtN+6k0=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:hGndIUm3WJkUd0g0usomjsf3V+A= sha1:RPmqps+z2kW3j+frehBwT6cdH0Y= Xref: csiph.com comp.lang.c:142224 ram@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse writes: > >> I think some of [leaving braces off of controlled statements when >> possible] comes from saving vertical space on OHP slides from the >> 80s and 90s. > > I am using a video projector now, but it's the same point: > > When programs have many lines, I need to use a smaller font > if I want the whole program to be visible on the screen, and > then some participant will not be able to read the characters > (of that small font) - or only a smaller part of the program > can be displayed (with a larger font). If a program has that many lines, it should be broken up into smaller pieces that can each be understood individually. > With my formatting style, however, I can insert braces > /without/ consuming more vertical space: > > for( i = 0; i < 10; ++i ) > printf( "%d\n", i ); > > becomes > > for( i = 0; i < 10; ++i ) > { printf( "%d\n", i ); } > > , and when another line is inserted: > > for( i = 0; i < 10; ++i ) > { printf( "%d\n", i ); > printf( "%d\n", i ); } This style has other defects, glaringly obvious, that more than overcome the comparatively minor benefit of taking one fewer line. A splendid example of the tail wagging the dog.