[seek-dev] Re: [kepler-dev] Query Builder Code Review
Edward A Lee
eal at eecs.berkeley.edu
Thu Aug 12 11:12:30 PDT 2004
At 11:17 AM 8/12/2004 -0500, Rod Spears wrote:
>Also, there seems to be some varying feelings and opinions about the
>coding style for Kepler. My approach which I am sure differs from Kepler
>is as follows:
>1) All method arguments start with a lowercase "a"
>2) All class data members all start with "m" (unless they are final)
>3) All local variables have no prefix.
>It is my belief that you should always be able to look at a variable in
>the code and understand it's scope. I disagree with the approach where
>both the method arguments and the local variables have no prefix and are
>often distinguished by a "this.", which is rather verbose at times.
While I think these are valid points,
I would like to make a case for following the coding style anyway...
There is no coding style that will appeal to everyone (I guarantee it).
The benefits of having a uniform coding style, however, far outweigh
_any_ benefits you might derive from any particular coding style.
So, I would suggest that the discussion needs to be:
1) What changes should be made to the uniform coding style?
2) Who's going to do the work to convert the existing code base
to conform with any changes in the coding style?
Number 2 suggests that changes had better have pretty compelling
reasons... I don't find the above reasons compelling enough...
(nor are they consistent: What if I name a local variable "model"?
Is it a class data member?).
I think the concerns addressed by this proposal are adequately
addressed by keeping methods short and by choosing readable
names for variables that a compositions of full words and clearly
define the role of the variable.
Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
More information about the Seek-dev