Abbreviated variable names are fine
Should you use full variable names, or abbreviated? The answer: doesn’t matter.
Fixing Faults in C and Java Source Code: Abbreviated vs. Full-word Identifier Names by an all-Italian team of Scanniello, Risi, Tramontana, and Romano.
This is a long paper with a short message.
Abbreviated identifiers are not a major obstacle to fault identification and fixing
Its’s a quantitative and qualitative study: it measures participants success and failure in debugging code with delibrate mistakes, and uses ethnographical methods to study these professional programmers. (Relevant Dilbert comic)
I do have a couple concerns.
-
The paper says that abbreviated identifiers make searching over the code a bit harder, because the developers didn’t use the correct abbreviations, or any, when searching. It didn’t significantly affect debugging, apparently, but I don’t know why not. I wonder if abbreviated identifiers is a minor obstacle.
-
I wish I could see what they consider abbreviated v full variable names. The only example I see is using “i” v. “iterator”, which isn’t a great example because programmers have long internalized what “i” stands for.