Sujet : Re: Which code style do you prefer the most?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 02. Mar 2025, 05:46:03
Autres entêtes
Organisation : None to speak of
Message-ID : <87frjwvy44.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
On Sat, 01 Mar 2025 17:24:58 -0800, Keith Thompson wrote:
If I wanted to annotate arguments with parameter names, I'd probably use
aligned // comments with the name at the end of the line:
confection = prepare_carefully_according_to_detailed_recipe(
flat, // pan
clarified_butter, // line_with
something_yummy, // filling
lotsa_pastry, // cover_with
90 * MINUTES // bake_for
);
>
Then they end up the wrong way round.
What's "wrong" about it?
Sure, I'd prefer to have the parameter name first followed by the
argument, but I'm not willing to uglify the code with /*...*/
comments to achieve that. And 99% of the time I don't bother
anyway.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */