> I use what you call the traditional style, but I know the reason for using
> the other style (and agree with it ... just never do it); defensive programming!
> If you meant to type "if(a == 5)", but you typed "if(a = 5)", it is legal syntax,
> and not only have you changed the value of a, but the expression always evaluates
> to true.
Thanks, I understand the rationale now... however, for me at least, this
is one of the most uncommon programming errors. I can't recall the last
time I made this particular error... IMHO, the readability of the
'traditional' style *far* outweighs any protection one might get from
using the other method. After all, quite a few conditionals are just
used for checking return values, so when reading a program quickly for
whatever reason, I want to see the function being called immediately,
at the beginning of the line, instead of having to scan across every line
to find it. At any rate, it was interesting since I'd never seen it
done that way before.
Joshua Jones :: jajones(at)cc.gatech.edu :: http://www.intmain.net
"Quotes in .sigs are useless." -- Me