Re: Style isn't always religious



"Richard Bos" <rlb@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43147ffc.10002367@xxxxxxxxxxxxxxxxx
> "Mabden" <mabden@xxxxxxxxxxxxxx> wrote:
>
> > I don't like postfix on a single variable. I always see it as:
> > var++ : Do nothing with var, then increment var before the next
> > instruction.
> >
> > Instead of just doing what you are there to do:
> > ++var : Increment var.
> >
> > No need to wait until after "var;" is executed (a null operation),
IMO.
>
> You are, of course, free to prefer one style over another as you
please;
> but in this case, your reasons for doing so are entirely fictitious.
> There is no wait whatsoever in var++ that is not also present in
++var.
> It seems that you do not understand how these operators work.


I just said that that is the way it "scans" to me. That's where the
words "I always see it as" differ from "the computer will take 3 less
cycles to perform this operation". I see it as "do nothing" then
increment, but that does not mean I think the computer sits there
wasting cycles. When I said "no need to wait".. I didn't really mean the
computer actually waits. I meant it as a way of thinking about prefix
and postfix. Sorry for the confusion, I should have reread that.

Besides, a compiler should drop a statement like "null;" as a do-nothing
statement anyhow.

It's kinda like how I prefer for (;;) which reads as "forever", better
than while (1) since "while one" doesn't really click with anything in
my mind.

That is what style is all about.

--
Mabden


.