Sujet : Re: comments, The joy of FORTRAN
De : c186282 (at) *nospam* nnada.net (c186282)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 04. Mar 2025, 04:58:10
Autres entêtes
Message-ID : <U8ucnSfoTMXH51v6nZ2dnZfqn_adnZ2d@giganews.com>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
On 3/3/25 12:33 PM, Charlie Gibbs wrote:
On 2025-03-03, Scott Lurndal <scott@slp53.sl.home> wrote:
c186282 <c186282@nnada.net> writes:
>
On 3/3/25 12:32 AM, rbowman wrote:
>
On Sun, 2 Mar 2025 23:19:41 -0500, c186282 wrote:
>
On 3/2/25 3:43 PM, John Levine wrote:
>
According to c186282 <c186282@nnada.net>:
>
Even 'clear' C is often NOT so clear - neither the syntax or logic.
You've gotta EXPLAIN every step to yourself.
>
Well, yeah.
>
i += 2; /* add 1 to index */
>
Actually, that adds 2 to the index
>
And here I thought it was an example of a comment that never was
updated...
>
COULD be :-)
>
Or the code could be bad.
>
Or it could be indexing pairs of values in an array.
In which case the comment should be something like
"Step to the next pair of values."
Yep :-)
Anyway, update yer code, update yer COMMENTS ... like
RIGHT THEN before you forget.
Did lots of stuff for remote sensors ... used single
'packed' arrays often .... <temp><pressure><flow>
<level><uid><datetime> progressively in that one array.
Super-easy to write, super-easy to save to a media.
But you DID have to increment by 'n' fields every time.
In 'C' it was easy to do bit-fields ... so many bits
for each kind of data. That made it even more imperative
to keep exact track. Hey, memory used to be small ....
so you PACKED IT IN - no 32 bits to hold 1,2 or 3 :-)
Decimal vals ... just mult by 10 or 100 and int().