Open main menu

CDOT Wiki β

Changes

Team !YOU - OOP344

351 bytes added, 15:21, 25 January 2010
m
(Discussion: Use of iterating variables on for loops): Added feedback
|-
| ammisko || I like option 1 better (I changed it a bit). I think it looks cleaner and is much easier to read for someone who doesn't know what the code does (especially with comments). Also what if we need to use a loop variable from outside the for loop? Or if we need to use the first part of the for-loop for other code? Option 1 could accommodate that better I think.
|-
 
| MattAdams || I like both ways. I use option1 when I need to use the counter for something else. And I use option2 when I need to right a quick for loop. As for a standard, I think option1 should be used, that way all of the variables are declared at the top of every function, and that way we don't have to copy the counter to another variable.
 
|-
|}
 
=== (Discussion: Variable names) ===
1
edit