« Return to Thread: Another formatting question: Short variable names

Re: Another formatting question: Short variable names

by Erik Engbrecht :: Rate this Message:

Reply to Author | View in Thread

Real programmers only need x, y, z, i, j, k, and temp.

On Wed, Jun 10, 2009 at 6:46 PM, Bill Venners <bill@...> wrote:
Hi All,

How do people feel about hd for variables that will hold the head of a
list, ls for list, etc. What about pred for predicate? Seems if there
are some very commonly used variable names like that it could make
things more readable, but head and list are just two characters longer
each, so I question whether that wouldn't make code more readable in
general.

Dave Astels once said, whatever you would answer when asked what a
particular variable is, that is what you should name that variable.
Sometimes that approach can result in long variables that can obscure
the logic, and I think sometimes an abbreviation makes things more
readable. But I seem to lean more towards longer more descriptive
variable names than others in my sphere of peers. When would you
shorten or abbreviate a variable name, and how short would you go?

Bill
----
Bill Venners
Artima, Inc.
http://www.artima.com



--
http://erikengbrecht.blogspot.com/

 « Return to Thread: Another formatting question: Short variable names