My problem with words such as DAA is that I constantly have to look them up to see exactly
what they actually do. Finding alternate uses it all about knowing what they actually do.
I know what they were put there for ( to keep banker happy ).
I constantly see people claiming how much better decimal is than the English system of
meassurment. I don't really think that much of the decimal number system. If we'd
only been born with 8 fingers on each hand, computers would have been so much easier.
Thing like powers of 2 are easier to understand in binary.
Such is life. If only we'd known.
Dwight
________________________________
From: cctalk <cctalk-bounces at classiccmp.org> on behalf of Fred Cisin via cctalk
<cctalk at classiccmp.org>
Sent: Friday, January 29, 2021 4:32 PM
To: General Discussion: On-Topic and Off-Topic Posts <cctalk at classiccmp.org>
Subject: Re: APL\360
>> if ( !(myfile = fopen( filename,
"r"))
On Fri, 29 Jan 2021, Guy Sotomayor via cctalk wrote:
In a lot of industry standard coding practices (MISRA,
CERT-C) that type of
statement is prohibited and *will* result in an error being reported by the
checker/scanner.
The if statement in your example has at least 2 errors from MISRA's
perspective:
* assignment within a conditional statement
* the conditional not being a boolean type (that is you can't assume 0
is false and non-0 is true...you actually need to compare...in this
case against NULL)
That particular structure has become an industry standard.
MOST dialects of C return a NULL pointer on fopen error.
Similarly the code in strcpy has an assignment and is using the numeric
valus of each character as if it were boolean, with the terminating NULL
ending the while condition.
There are some situations where some code might not be obvious to all, in
which case good comments provide the explanation.
For example, when I use DAA or AAM, etc. in X86 assembly language, I
always comment heavily since my uses for breaking up and/or printing
numbers are not the original intent for those instructions.