Bill Venners 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
>
I prefer head, list and predicate, but 'pred' is more acceptable than
'hd' or 'ls'.
> Dave Astels once said, whatever you would answer when asked what a
> particular variable is, that is what you should name that variable.
>
That's a nice heuristic. I prefer longer names and feel anything up to
about 7-10 chars in length should be written out in full. As the length
increases, abbreviation becomes more appropriate and almost mandatory
beyond 20 chars .
However convention establishes some shorter forms, eg x and xs for
pieces of lists, f and g for opaque function values.
-Ben
> 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>
--
*Ben Hutchison
Senior Developer
* Level 2 476 St Kilda Road Melbourne VIC 3004
T 613 8807 5252 | F 613 8807 5203 | M 0423 879 534 |
www.ibsglobalweb.com <
http://www.ibsglobalweb.com/>