Sujet : Re: The joy of FORTRAN
De : cross (at) *nospam* spitfire.i.gajendra.net (Dan Cross)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 03. Mar 2025, 01:16:19
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <vq2scj$144$1@reader1.panix.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vB5xP.126521$eNx6.22176@fx14.iad>,
Charlie Gibbs <
cgibbs@kltpzyxm.invalid> wrote:
[snip]
Here's one of my favourites:
>
if((month == 9) /* Thirty days hath September, */
|| (month == 4) /* April, */
|| (month == 6) /* June, */
|| (month == 11)) /* and November. */
modays = 30;
else if(month != 2)
modays = 31; /* All the rest have thirty-one, */
else if((year % 4) != 0) /* Except for February alone, */
modays = 28; /* Which has but 28 days clear, */
else
modays = 29; /* And 29 in each leap year. */
Ha, I really like that.
Oh, and anyone who modifies code without updating the
corresponding comments to reflect the change deserves
some sort of nasty punishment. Maybe we can make them
maintain any other programs whose comments have become
outdated and misleading.
John Ousterhout recently published the contents of a written
"debate" he had with Robert C Martin that went into this at some
length. With the caveat that I think Martin is a charlatan,
folks here might find it interesting and relevant.
https://github.com/johnousterhout/aposd-vs-clean-code/blob/main/README.md - Dan C.