Monday, January 23, 2006

Naming your new variables

There are these lists around of popular baby names for a given year. (No links, do your own Google search). I wonder what such a list would look like if someone did the same tabulation for variable names in programs? How would it change over the years? ("i" and "j" would probably be perennial favorites, with "idx","indx",and "index" not far behind)
Seeing the lists broken down by "ethnicity" (ie, programming language) would be interesting as well.

On a related note, expectant parents have books of baby names at their disposal for aid in choosing a name. I wonder if programmers could use such a resource to assist in naming their variables (and functions and namespaces, etc)?
(Actually, a thesaurus is handy for that purpose. (Ugh, I just answered my own rhetorical question))

2 comments:

Mark said...

Hmm. Modifying and republishing an entry apparently deletes all the comments. This is disturbing and annoying.

jfklein said...

Wow, I'd be enthusiastic about seeing a tabulation like that. I'm guessing that if you looked at all source code though it would be heavily influenced by the tendency to have context-related affixes, with internal product or module names.