Re: question about initializing variables to 0



David Flower wrote (in reply to James Giles):
I respectfully disagree about your non use of the intrinsic CMPLX.

The problem is not how the code looks to you, but how it looks to a
future maintenance programmer.

When there is a choice between two ways of writing code, other things
being equal, the more standard one should be chosen.

Yes. But things are not equal; the requirement for the KIND argument to CMPLX is a bit counterintuitive to some programmers, and thus can lead to errors of omission, and thence to lurking bugs of the sort that may well still be lurking (and subtly corrupting results) years later.

In addition, in some cases one has a fairly good idea of the opinions of the future maintenance programmer who will be working on the project, and can program in ways that match their expected idiosyncracies. (In particular, this happens when the maintenance programmer is likely to be oneself some years later.) My guess is that James falls into this category much of the time, and has fairly good evidence that his future maintenance programmer will prefer the .I. operator. :)

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.
.