Saturday, September 8, 2007

Naming variables

It is important that our code can be read, by ourself or by others, so it is very likely to name of our vars explain what they contain.
Personally, I don't like to include the data type in the variable name, but what it mean.
As an usual exception to this rule you have the variables with no real sense, but useful, for example

for ($i = 0; $i < N; $i++) {
for ($j = 0; $j < M; $j++) {

}
}

No comments: