News for hackers. Stuff that matters.
Re:The pitfalls of jargon and the damage it does to mathematics by Wickk on Tuesday May 24, 2011 @11:37AM (#2580235)
What you're describing is actually bad practice. Not saying it's not a problem, but that's not an intentional emulation.
Re:The pitfalls of jargon and the damage it does to mathematics by Peaker on Tuesday May 24, 2011 @06:01PM (#2581851)
It depends. Variable name length is mainly related to two things:

* Scope the variable resides over

* Generality of the variable

If the scope is large (the variable is global and exposed to a lot of code), the variable name has to be longer, so that far away readers can make sense of it. A variable that scopes over 2 lines is allowed to be much shorter, especially if its definition is as clear or clearer than an arbitrary name.

As for the generality, if you write a function addEmployeeSalaries, of course that is a better name than some arbitrary short name (e.g: "addEm").

But when writing (very very) general code, it is hard to avoid situations where the variable denotes only structure. It is just too general to find a useful long (and specific) name.

For example, consider:

    flip f x y = f y x
    
    sequence :: Monad m => [m a] -> m [a]
Single-letter variable (and type variable) names, but considered perfectly good practice.