Now that's a first [modified]
-
In all of computer programdom, I've never encounterd this arrangement of i & iCount in a for loop:
i = getcountofsomething() For iCount = 0 To i If something(iCount)) Then bOk = True Exit For End If Next iCount
modified on Thursday, February 11, 2010 6:33 PM
-
In all of computer programdom, I've never encounterd this arrangement of i & iCount in a for loop:
i = getcountofsomething() For iCount = 0 To i If something(iCount)) Then bOk = True Exit For End If Next iCount
modified on Thursday, February 11, 2010 6:33 PM
It's not that bad - I assume getcountofsomething() takes a while, so the coder has just manually optimised it out of the loop.
If Barbie is so popular, why do you have to buy her friends? Eagles may soar, but weasels don't get sucked into jet engines. If at first you don't succeed, destroy all evidence that you tried.
-
It's not that bad - I assume getcountofsomething() takes a while, so the coder has just manually optimised it out of the loop.
If Barbie is so popular, why do you have to buy her friends? Eagles may soar, but weasels don't get sucked into jet engines. If at first you don't succeed, destroy all evidence that you tried.
-
nah, it's bad. who names their variables like this in a for loop? were it written "for i = 0 to iCount", I'd be giving this guy a high 5 already.
A high 5 around the earhole?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
In all of computer programdom, I've never encounterd this arrangement of i & iCount in a for loop:
i = getcountofsomething() For iCount = 0 To i If something(iCount)) Then bOk = True Exit For End If Next iCount
modified on Thursday, February 11, 2010 6:33 PM
It's straight from the guide on How To Write Unmaintainable Code[^]:
Never use i for the innermost loop variable. Use anything but. Use i liberally for any other purpose especially for non-int variables. Similarly use n as a loop index.
-
It's straight from the guide on How To Write Unmaintainable Code[^]:
Never use i for the innermost loop variable. Use anything but. Use i liberally for any other purpose especially for non-int variables. Similarly use n as a loop index.
-
A high 5 around the earhole?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
In all of computer programdom, I've never encounterd this arrangement of i & iCount in a for loop:
i = getcountofsomething() For iCount = 0 To i If something(iCount)) Then bOk = True Exit For End If Next iCount
modified on Thursday, February 11, 2010 6:33 PM
You just don't understand. If the variable was named count you would have a point. Here, the programmer was helping the poor computer with its communications skill. Hence naming the variable that the computer uses to count from its own perspective - "I Count"
Please do not read this signature.