Sujet : Re: Which code style do you prefer the most?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 28. Feb 2025, 14:26:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vpsdhm$3maj1$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 28.02.2025 11:19, Richard Heathfield wrote:
On 28/02/2025 09:21, Janis Papanagnou wrote:
On 28.02.2025 09:55, Richard Heathfield wrote:
<snip>
>
On the other hand, I maxed out at 24.
>
It would be interesting to get to know what sort of code-lines
or what sort of code-structure these extreme values stem from.
I thought so too, so I looked, and of course it's not as interesting as
we might have hoped.
I'm not allowed to post the code here, but I can paraphrase:
value = really_quite_extremely_long_function_name(arg1,
arg2,
arg3,
arg4);
Actually, this sort of structure was exactly what I thought of
when you spoke about such huge indent values.
I don't have such extreme formatting, but structural similar
variants; elsewhere I had posted this fragment
if (sscanf (mutations, "r:%u,g:%u,a:%u,d:%u",
&mutation_rates.base,
&mutation_rates.genesis,
&mutation_rates.aging,
&mutation_rates.death
) != 4)
but I have the habit to not use Tabs for the excess indenting;
informally written it looks like
<Tab><Tab>if (sscanf (mutations, "r:%u,g:%u,a:%u,d:%u",
<Tab><Tab> <spaces> &mutation_rates.base,
<Tab><Tab> <spaces> &mutation_rates.genesis,
<Tab><Tab> <spaces> &mutation_rates.aging,
<Tab><Tab> <spaces> &mutation_rates.death
<Tab><Tab> <spaces> ) != 4)
so that the code structure and alignment stays the same when
changing indent tabs (from 4) to values of, say, 8 or 2.
The side-effect is that the space-alignment gets not counted
as [arbitrary long] indents when counting the leading <Tabs>.
Janis