db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Coding guidelines
Date Tue, 01 Nov 2005 09:58:35 GMT
"David W. Van Couvering" <David.Vancouvering@Sun.COM> writes:

> I can't find the email, but I could have sworn when I first started
> that I was referred to the Java coding guidelines at
> http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
> If we agree this is as good as any other standard, it would be good to
> adopt it as our own coding guideline and publish this somewhere...
> I do know one key standard: four-space tabs.

Maybe the Derby code consistently uses four-space tabs, but it does
not use tabs and spaces consistently. There are 1738 Java files in the
trunk, of which 1712 contain lines starting with at least four spaces,
and 1540 contain lines starting with at least one tab. If you count
the number of lines, 179180 lines start with at least four spaces and
365030 start with at least one tab.

The Java coding conventions at [1] says this about tabs:

  Tabs must be set exactly every 8 spaces (not 4).

The Geronimo coding standard [2] which Satheesh referred to in a
comment to DERBY-587, states that tabs should not be used for

> We seem to be fairly
> inconsistent about everything else, although that said most of the
> code is fairly readable.

Yes, the code is readable, but I think a coding standard would be
useful anyway. If I had not seen last month's voting discussions, I
would have proposed the following coding standard for Derby:

  - Follow the conventions specified at [1].
  - Don't use tabs.

[1] http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
[2] http://wiki.apache.org/geronimo/CodingStandards

Knut Anders

View raw message