Another rule of thumb:
Don't do pre-incrementing!
It's generally unintuitve for humans to think that way? isn't it.
ie. none of this -> ++myValue
instead do this -> myValue++
That way the value is changed afterwards, instead of before.
Although, in a for loop i believe it stays the same, but it's a bad habit to get into!
post increments!!!!!
[EDIT]
from Resource standard metrics
Quality Notice No. 7
Emit a quality notice when a pre-increment operator '++' is identified within the code.
Language: C and C++ for preprocessor anomalies and C, C++ and Java for understandability of the code.
Rationale: The pre-increment of a variable occurs before the remainder of the processing in the statement. This can be difficult to comprehend or anticipate. There are documented cases where the mathematical results vary between the result of macros when different code preprocessors expand the macros into a normal form.
List Of Quality Notices/Standards
[/EDIT]
Also, even though if or for statements (or other condition logic) is only one line long, make sure you still bound it with the curly braces{}
It's got to do with readibility and integrity of the coding. Surely there are some good coding standards published on the web? They're important habits to learn, as you learn, otherwise they could be hard to break
also, as knifemissle pointed out, try to keep variables local to what they're used for. Globals are bad news
Sorry, but i am a little bit of a code quality/standards whore
