Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Fri, 28 Feb 2025 16:34:53 +0200 Organization: A noiseless patient Spider Lines: 67 Message-ID: <20250228163453.000038a0@yahoo.com> References: <87frk10w51.fsf@onesoftnet.eu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Date: Fri, 28 Feb 2025 15:34:58 +0100 (CET) Injection-Info: dont-email.me; posting-host="89b03e3b0877100404baa3b494d11b6e"; logging-data="3805408"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tU2XThDjagNlQMcTq2KmDpI3g7Ugiy2I=" Cancel-Lock: sha1:O/NES083CUlvvCTlhqgQz9Rl2J0= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) Bytes: 3503 On Fri, 28 Feb 2025 14:22:05 +0000 bart wrote: > On 28/02/2025 10:19, Richard Heathfield wrote: > > On 28/02/2025 09:21, Janis Papanagnou wrote: =20 > >> On 28.02.2025 09:55, Richard Heathfield wrote: =20 > > =20 > >> =20 > >>> On the other hand, I maxed out at 24. =20 > >> > >> It would be interesting to get to know what sort of code-lines > >> or what sort of code-structure these extreme values stem from. =20 > >=20 > > I thought so too, so I looked, and of course it's not as > > interesting as we might have hoped. > >=20 > > I'm not allowed to post the code here, but I can paraphrase: > >=20 > > =A0 value =3D really_quite_extremely_long_function_name(arg1, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 arg2, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 arg3, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 arg4); > >=20 > > > > =20 >=20 > I think I'd go with this: >=20 > value =3D really_quite_extremely_long_function_name( > arg1, > arg2, > arg3, > arg4); >=20 Same here. Except that I'd use even smaller indentation. But not for printf(). For printf I prefer printf("short format %d+%d+%d=3D%d\n" ,arg1 ,arg2 ,arg3 ,arg4 ); When format string is longer I put it on the separate line as well. > Since the args would then also line up with a similar call but where > the function name is a different length: >=20 > value2 =3D a_somewhat_shorter_function_name( > arg1, > arg2, > arg3, > arg4); >=20 > That's assuming it is still not viable to have them all on the same > line.