Re: Style isn't always religious
- From: "Mabden" <mabden@xxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 09:51:11 GMT
"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
.
- References:
- what is difference between sizeof and strlen
- From: rahul8143
- Re: what is difference between sizeof and strlen
- From: Chris Dollin
- Style isn't always religious
- From: Tim Rentsch
- Re: Style isn't always religious
- From: Baxter
- Re: Style isn't always religious
- From: Richard Tobin
- Re: Style isn't always religious
- From: Tim Rentsch
- Re: Style isn't always religious
- From: Baxter
- Re: Style isn't always religious
- From: Mabden
- Re: Style isn't always religious
- From: Richard Bos
- what is difference between sizeof and strlen
- Prev by Date: Re: More questions about casting function pointers ..
- Next by Date: Re: Detect if stdin is via keyboard or via < file?
- Previous by thread: Re: Style isn't always religious
- Next by thread: Re: Style isn't always religious
- Index(es):