Re: For Next statments

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages