Re: For Next statments
- From: "Jim Mack" <jmack@xxxxxxxxxxxxxxx>
- Date: Sun, 20 Nov 2005 17:04:40 -0500
Wagon@xxxxxxx wrote:
> THe code analyzer that I am using claims that
>
> For i = 0 to 10
> ...code
> Next i
>
> Is slower than
>
> For i = 0 to 10
> ...code
> Next (without the i)
>
> I was taught it is good practice to put the "i" o make the code
> readable
>
> Which do you think is better?
In an interpreted language, leaving off the token might be marginally faster, but in a compiled program I can't see how it would make any difference -- that sort of thing should be long gone by the time the code actually runs.
If your loops are so dense or nested that seeing the identifier helps you (or the maintainer) tell what's happening, then use it. Personally, I never do.
--
Jim Mack
MicroDexterity Inc
www.microdexterity.com
.
- References:
- For Next statments
- From: Wagon
- For Next statments
- Prev by Date: Re: For Next statments
- Next by Date: Re: Need help with ReadFileEx()
- Previous by thread: Re: For Next statments
- Next by thread: Re: For Next statments
- Index(es):
Relevant Pages
|