Just an observation
When some programmers pick up a functional programming language like Microsoft Excel, they stop caring about identifier names.
A1 = blah B1 = function(A1, C2) ...
Can this observation be explained while maintaining consistency? I think it can.
July 7th, 2008 at 5:55 pm
Most such variables (or sets of variables) are named through having a title. I think Excel increases 100-fold the number of programmers in the world.
July 7th, 2008 at 11:19 pm
I have noticed this too, but I never made the connection of the usage of single letter identifiers with people just coming to FP (not that that connection isn’t there, I just didn’t make it).
Is there any validity to my suspicion that since FP is more grounded in mathematics that imperitive (is that a true hypothesis?) that FP code tends to look more like mathematics?
Ricky:
Way back when a self-proclaimed Excel “stud” colleague of mine wrote a fairly complete application in Excel to handle his bank accounts. It did essentially what the first couple versions of Quicken did, but all in Excel. He even had it emit touch-tone phone tones to navigate his bank’s phone-based interface to do funds transfers, payments, etc. (This was all pre-web.)
July 8th, 2008 at 6:57 am
Because you don’t have to trace mutable aliases through your code, names in functional languages can be less descriptive. I’m not sure if this is a good trend or bad (I tend to think “bad”), but it’s certainly happening. It also could be due to the fact that imperative languages require a *lot* of variables and assignments. At any one time, you’re hauling around so many more symbols that you *need* to either have some very complex scoping, or be sure to have unambiguous names for everything. All of that goes away in functional languages. The only reason to create a variable is to make code more readable by breaking apart a complex expression. I guess it only makes sense that the shorter, more “typeable” names tend to triumph over the longer, more descriptive ones.
July 9th, 2008 at 10:50 pm
For me if the function is small enough, using a single letter for a variable name is more of a convenience.
The types of the variables reveal the actual meaning.
July 25th, 2008 at 3:24 am
> they stop caring about identifier names.
I don’t stop CARING, I just stop using them. I think one of the big weaknesses of Excel as a coding environment is the inability to abstract things like names for the cells or for a formula. (Technically, it’s possible but difficult… in the end we don’t do it, so it comes down to the same thing.)