Re: How to name variables in a program?
- From: "Phlip" <phlip_cpp@xxxxxxxxx>
- Date: Mon, 30 May 2005 04:12:09 GMT
August Karlstrom wrote:
> Personally i think e.g.
>
> name := person.Name()
>
> makes more sense than
>
> name := person.GetName()
Naturally - some methods are passive and not verb-able. Sometimes Get should
balance Set. And sometimes we risk starting a thread on why
accessor/mutators are sometimes a design smell!
Consider person.Get("Name").
And don't get me started about :=. You must type two characters for the most
common form of equalization (assignment), just to appease the self-righteous
indignation of some old grumpy math professor. It ain't me.
> > - don't use l, i, O, etc. for local variables.
>
> You probably mean
> - don't use l, I, O, etc. for local variables.
Also don't use i. Just because everyone else does it doesn't make it right.
> > - use camelCase for methods
>
> This is standard in Java. Other languages has other conventions.
"standard"? The Java hook is the language started recently, from a single
source, and spread rapidly, conveying the style of its progenitors.
--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand
.
- Follow-Ups:
- Re: How to name variables in a program?
- From: August Karlstrom
- Re: How to name variables in a program?
- References:
- How to name variables in a program?
- From: SerGioGio
- Re: How to name variables in a program?
- From: Phlip
- Re: How to name variables in a program?
- From: August Karlstrom
- How to name variables in a program?
- Prev by Date: Re: Suggestions for double-hashing scheme
- Next by Date: Re: Relaying Access Denied
- Previous by thread: Re: How to name variables in a program?
- Next by thread: Re: How to name variables in a program?
- Index(es):
Relevant Pages
|