wtd wrote:
As for Hungarian notation (prefixing the name of the variable with the type), it is wholly worthless. Just use meaningful variable names.
disagree. while i dont support these naming styles, it sometimes helps to figure out what type a variable is easily if your compiler doesnt provide this functionality.
once I had. for (i=0;i<v.size()-1;i++) ...
well guess what? v.size() is an unsigned int, so 0 - 1 get casted to 0xFFFFFFFF and i get an infinite loop when the vector is empty. So if someone wrote code like:
iSize = v.size() - 1;
for (i=0;i<iSize;i++) ...
then when debugging it might have jumped out, than something like
numIterations = v.size() - 1;