Walter Roberson:
I would point out that your offering was functionally equivilent to
mine (the one that used explicit casts in both locations), so -you-
were the one worrying about prettiness, not functionality.
Actually, my intent was to point out a flaw. Let's start off with two
char's:
char a,b;
Let's say we want to add the two of these together, and for the result to
be unsigned. All we need do is:
(unsigned)a + b;
However, what _you_ proposed was:
(char unsigned)a + (char unsigned)b;
Which might be equivalent to:
(int)(char unsigned)a + (int)(char unsigned)b;
, depending on whether "char unsigned" promotes to "int" or "unsigned". On
the majority of implementations, it promotes to "int". On such systems, the
result will therefore be a signed int.
You were commenting on elements of my code that did not affect
the functionality but did affect the readability, so it was completely
fair for me to comment on the elements of your code that did not
affect the functionality but did affect the readability.
I pointed out the flaw. At times though, I also point out redundancies. If
I see:
double a;
long b,c;
a = (double)b / (double)c;
, then I'd point out that only one cast is required:
a = (double)b/c;
However I tend not to comment on things like:
int const Vs const int
i++ Vs ++i
Do I need to locate and cite your previous articles in which
you explain your choice of syntactical order?
You suggested that my word order would change because of the context.
You *did* make such an explanation, and your most recent usage was
contrary to that explanation.
_You_ think so, because of the context. Perhaps was reasoning doesn't go so
far as to take the context into account, but rather picks one syntax that
should be used throughout. Who knows?! I stopped thinking about it a long
time ago and I just go with the flow now.
You did not apply the reasoning that you had earlier
stated. We must therefore conclude that you apply your
previously-stated reasons inconsistantly; or that your previously
stated reasons were not your real reasons; or that your previously
stated reasons were not your -complete- reasons.
Or you could conclude that you do not understand my thinking, or that my
thinking takes into account the probablity that Alaska will suffer flash-
floods on account of Global Warming.
This allows for a possibility that I did not allow for earlier,
namely that your actual reasoning might be quite consistant but that
your actual reasoning does not match your statements about your
reasoning.
I am done explaining why I like red ribbons that turn clockwise on my
bicycle. Please see past the ribbons and look at the actual bicycle, as
I've had my fill of explaining my preference.