Bad variable names
Writing about web page http://c2.com/cgi/wiki?BadVariableNames
I often find myself going back and fiddling with variable and method names in my code. Not that choosing names is tricky – not too long, not too short, stick to something descriptive, or conventions like getThis(), setThat(), but I often find room for improvement when I revisit a project. A while ago I was asked to add some functionality to a Flash component and found some var naming horrors in there, stuff like var abc = “1”; and var this:String = this;
Programmers often use generic or fake names when providing code examples. Everyone knows foo and bar of course, but my part-time programmer status was however confirmed today when I learnt that these two have a sibling, baz. I’ve got use baz sometime. So I thought look up some of examples of naming lameness, just to reassure myself that I’m not completely crap at choosing var names. This page has some great examples:
$data
getInfo()
const int EIGHT = 8;
If these were used for coding examples they’d be quite funny, but they’re not, so my prize for “Best Fake Variable Names in a Coding Example Ever” goes to Chris, with this:
MemCachedClient client = new MemCachedClient();
client.set("ramalama", "dingdong");
String foo = (String) client.get("ramalama");
System.out.println(foo);
I still laugh out loud at that one. Class.

