Gye Greene's Thoughts

Gye Greene's Thoughts (w/ apologies to The Smithereens and their similarly-titled album!)

Friday, April 03, 2009

Geeky amusement

Had a meeting with a local govt. dept. today. About a year ago, they got a new database, developed by someone who (apparently!) was an academic, rather than a ''working'' programmer:

Variable names tend to be from 20 to 60 (yep -- SIXTY) characters long. Ouch!

(Or, ''field names'', I suppose -- that's what DB folks call 'em, right?)


Example: "IncomeFromYearAfterEnteringWorkforce" instead of "IncYrAftWrk" (or similar). The nuisance bit for the govt. IT folks that work with this data is that standard statistical software (e.g. SAS, Stata) has a limit of about 30 characters for a variable -- so before they can run any analyses more complicated than a database-type query, they have to alter many of the filenames.


Sixty characters long... I was chuckling over that all day...


--GG

2 Comments:

At April 04, 2009 1:54 PM, Anonymous Anonymous said...

Actually, long variable names within code aren't really that uncommon. I'm sure we've got several that are longer than 60. In the past when disk space and memory were at a premium, it was good to have short names to avoid taking up excess space. However now it's not so important and worth trading the space for clarity. Which would you rather try to figure out (and try to remember): "ad = pb + cc" or "amountDue = previousBalance + currentCharges"? It's also not really an issue since with many current editors, you will get auto-complete help on variable names. "prev +ctrl+space" => "previousBalance". I now only generally only use names like "x" and "i" for things like counters/loops where the scope is limited and the meaning is obvious. So its not really that wierd and not a problem unless you're using arcane statistical programs for the social sciences. :)
-GC

 
At April 04, 2009 8:26 PM, Blogger Gye Greene said...

Good point, of course -- coming from GC!

But: wouldn't it be more elegant to use some standard abbrevs -- e.g. "amtDue" for "amountDue"?

Among other things, would make for nicer printouts...

But, yeah: auto-complete -- good stuff.


--GG

 

Post a Comment

<< Home