Re: How to name variables in a program?



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


.



Relevant Pages