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: Coding style for small if statements
Date: Sun, 16 Feb 2020 07:10:34 -0800
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <867e0mftzp.fsf@linuxsc.com>
References: <20200131234613.59047e037939ceb549b8e6d6@gmail.com> <65de5d07-838a-4a5f-bd70-b8a263fc61d6@googlegroups.com> <87imkkobdm.fsf@bsb.me.uk> <726b2209-ca7e-40fe-b429-fbc062f5b6bd@googlegroups.com> <87mu9v1dtv.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5afe6ca82d77f883ab9def33834e0994"; logging-data="6947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6LMiEt/EbIcQ636cDG3XY3fTx7BcrzDo="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:vrdqY8DtWFNeoEoOcAkTkgQVAEA= sha1:HngYFKLYWlHIcDTnXr/v6to7nzo=
Xref: csiph.com comp.lang.c:150053
Les Cargill writes:
> There's something to be said for having a code formatter/pretty
> printer in the code checkin process.
IME that's not a good idea. Any reasonably large program
invariably contains some deliberate "violations" of the layout
conventions being followed, and automated formatters mess those
up. Such cases aren't just contrariness on the part of whoever
is doing the programming: just as in writing English prose,
sometimes it is important to break a style rule, to get a better
result; taking a slavishly mechanical attitude has problems if
followed rigidly and without exception. Code formatters are
great for getting an unruly code base "shipshape and Bristol
fashion" before editing starts. Not so much later during
normal development.