|
From: Vincent M. <vm...@oc...> - 2001-08-22 06:49:55
|
----- Original Message -----
From: "Steve Freeman" <st...@m3...>
To: <moc...@li...>
Sent: Wednesday, August 22, 2001 2:09 AM
Subject: Re: [Mockobjects-java-dev] Coding conventions for the sources
> 1. Sometimes I start class and method braces on the same line. Depends on
how complicated the signature is. Compact is better.
what do you mean sometimes ? We need to choose ... and I don't agree that
compact is better. For me, the more readable is the best, compacity was an
issue when we had not enough memory ...
I prefer :
out.println("aaa");
out.println("bb");
than
out.println("aaa");out.println("bb");
> 4. we don't believe so much in javadoc. that's why we ship the sources and
tests.
Yes, you already told me this ... :) But you've never answer the question I
asked Tim (and you) ... Which was :
"
Tim (and Steve), how often do you look at the JDK source code when you need
to
understand how the BufferedReader.readLine() methods works and what it
returns if there is no more data to be read from the stream ?
Personnally I don't (although it is available, I even have it on my machine)
and I prefer to look at the javadoc !
Want to make a bet on how people do it ? :-)
"
I agree to some extent that javadoc won't be needed for mock implementation
but I don't agree for core classes. But don't worry I can do it myself if
you don't want to do it. It is always better that someone external write it
because that person will know what's difficult to understand.
> 7. I used to like the 'this.' convention, but went off it. I don't feel
too strongly. The advantage of a prefix, such as 'my' is that completion is
more focussed, especially on a large class.
Personnally, I liked "m_XXXX" but on the last 5 projects I've worked on,
almost everyone else was against me ... and I accepted their choice to use
the Sun convention (no prefix). Shall we go for that or do you want to keep
'my' ?
> 8. method parameters should not clash with a class variable, or be
prefaced by 'a', not 'the'
do you want 'a' ? It's fine with me.
> 9. 78 characters per line
ok, if you wish. I'll change that.
> 11. Logging isn't really appropriate.
err ... it is not in the coding conventions I have put .... (it was for
cactus though)
> 12. 'throws' clauses make explicit statements about the implementation of
your code. throwing exceptions straight through can sometimes be the best
thing to do, e.g. for IO. Each framework should have a base exception class.
etc.
err ... it is not in the coding conventions I have put .... (it was for
cactus though)
As we are only 2 to discuss for the time being, it's easier to agree on
something. I don't really care. Just tell me clearly what you absolutely
want, prefer or don't care. Also, please check the coding_conventions.xml in
CVS as this is our reference document.
Thanks
-Vincent
|