I agree, 'headIndex' is not much harder to type than 'iHead'.
If the for-loop is short then having an index called 'i' isn't a problem. If it's long, use long names.
Printable View
I agree, 'headIndex' is not much harder to type than 'iHead'.
If the for-loop is short then having an index called 'i' isn't a problem. If it's long, use long names.
Eric Lippert also has a good article on hungarian notation.
Quote:
What's Up With Hungarian Notation?
But if I see
then I know that there is a serious bug here! Someone is adding a count of bytes to a count of characters, which will break on any Unicode or DBCS platform. Hungarian is a concise notation for semantics like "count", "index", "upper bound", and other common programming concepts.Code:cbFoo = cchBar + cbBlah;
And in fact one day about seven years ago I changed every variable name in the VBScript string library to have its proper Hungarian prefix. I found a considerable number of DBCS and Unicode bugs just by doing that, bugs which would have taken our testers weeks to find by trial and error.
By using the semantic approach rather than the storage approach we eliminate the anti-Hungarian arguments: