|
Hmmm... Just how does one state any clearer that I understand
INZ() can be insignificant. However a million versus none, I will
*not* admit is insignificant in just about any code. To suggest
otherwise IMO is little short of justifying bloatware.
But my point was that the person so oblivious as to not notice the
pointer was not set would be the same person to not notice that the
pointer was set but to uninitialized data. So who is more helpful?
The person who ensures the poor coding effects MCH3601 and thus
failure, or the person who assists the coder in seeing incorrect
output?
While I concede setting just one pointer is insignificant, the
possibility does exist to prevent unnecessarily setting the pointer
if the array will not be referenced. Functionally however, choosing
to not set the pointer until the data will be referenced ensures a
"pointer not set" condition for misuse, thus exposing failed
assumptions in the code.
Ummmm.. it is not a failed assumption if it is true, Chuck!
The "failed assumption" is that the storage is available for
reference for its intended purpose when in fact it is not. If in fact
the data is not available but able to be addressed, then the
assumption that the data is available is a "failed assumption".
If the pointer is set since the first instruction, then any
statement in the program is allowed to reference potentially
uninitialized "data" in the array; i.e. to reference the data in
the array even if no open has transpired, or even if no READ has
populated the array.
So to avoid someone changing it, name the pointer
pDont_Change_Me_ever. Or use the popular 'constant' convention
(borrowed from C, by the way - I might as well aggravate Simon
also...) : name it P_DONT_CHANGE_ME_EVER. It's not like you need to
refer to it or anything. What you say above is true of ANY pointer
no matter how it's initialized; wouldn't you agree? BTW:
you seem to think that open of the file will matter here. It won't.
I never said anything about changing the pointer or its address to
something other than the location where the data will reside. I
clearly stated the effect is the *same*, as in regardless of *when*
the pointer is set, the address is the same. It is the *when* that is
relevant for any code that might *assume* the location is validly
addressable.
Thus if the file is never opened and\or never read, or even perhaps
if no row was found, possibly the pointer need never have been set.
I'm shaking in my boots to think of all the power and time it tookto
set that pointer. How could I have digressed so badly? :)
Sheesh, Chuck!
I can only infer you have never coded for an OS. To each his own.
As I started my response very clearly... FWiW.
I just happen to understand that many tens [probably hundreds] of
defects had been coded to such false assumptions in the OS [causal
analysis], and I am not ashamed of warning others against such
programming which allows so easily falling into the same trap. I
intend to help others just as you seem to intend... and I do not feel
someone belittling my attempts to do so is any more beneficial than if
I were to belittle yours. The aim is to complement suggestions or
provide valuable insight as to why they are not of benefit... such as
one might do to provide a critical review.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.