Deutsch   English   Français   Italiano  
<20250304142114.131@kylheku.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups: comp.lang.c
Subject: Re: Which code style do you prefer the most?
Date: Tue, 4 Mar 2025 22:26:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20250304142114.131@kylheku.com>
References: <vpkmq0$21php$1@dont-email.me>
 <20250304175602.c9fe683d678d3a2ed101a4ac@g{oogle}mail.com>
 <vq75k8$1t6ut$2@dont-email.me> <vq785i$1u7v7$1@dont-email.me>
 <20250304101022.154@kylheku.com> <vq7shq$226p3$1@dont-email.me>
 <vq7u5u$21gol$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 04 Mar 2025 23:26:13 +0100 (CET)
Injection-Info: dont-email.me; posting-host="513561c181a980206f31ea7942edad9d";
	logging-data="2181127"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/RJWcIBN7+8JIo1UaopWYv9PmG5yu4agc="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:y+WDFzOwIethHYPhK2lPTtmspOs=
Bytes: 2199

On 2025-03-04, Richard Heathfield <rjh@cpax.org.uk> wrote:
> On 04/03/2025 21:49, Richard Harnden wrote:
>
><snip>
>
>> 
>> I like the brace on its own line.  It visually separates the 
>> condidition from the statement.
>
> Agreed.
>
>> 
>> How do people format long and complex conditions, given that 
>> you're trying not to a much over 80 columns?
>
> I like to break after a binary operator so that it is 
> syntactically obvious that the line must continue:
>
> if((a != b        &&
>      c != d        &&
>      e != f)       ||
>     (g = h() * i() &&
>     (j = k))
> {
>    foo();
> }
>
> (You'll be glad to hear that that's not a direct quote!)

  (when (or (and (/= a b)
                 (/= c d)
                 (/= e f))
            (and (= g (* (h)
                         (i)))
                 (= j k)))
    (foo))


-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca