Monday, October 08, 2007

Agonizing Choices

A programmers life is filled with choices.  How should I implement that feature?  What's more important here, speed or memory?  What to eat with my coffee for breakfast.

The last two days have been filled with an agonizing choice dealing with variable names.  For the non-programmers variables are a way of accessing data via a name.  They are fundamental to programming and used literally everywhere. 

In particular I use a lot of PowerShell and my main profile creates a global variable which contains a lot of commonly used data.  Directories I search a lot, various computer paths that are important and other data. 

The choice?  What to name the variable?

Needless to say I type this variable's name a lot.  For various reasons the name needs to be mostly unique and it's a personal profile so I named Jpx for "jared powershell extensions".  However a day after I made this choice a problem came up. 

Typing the name took too long.  Unfortuantely with my keyboard layout the 4 keys needed to type $Jpx are horribly aligned.  I can use a maximum of 2 fingers and I can't interleave them because $PX use the same finger.  J uses a different finger

I kid you not that I spent hours thinking about this.  I practiced typing it to see if I could get more comfortable with it but to no avail.  Eventually I thought a long time and came up with a new name. 

$Jsh is the new winner.

0 Comments:

Post a Comment

<< Home