You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Rick Hillegas <Ri...@Sun.COM> on 2005/10/31 17:17:13 UTC

Coding guidelines

Hm, let me try this again.

Where would a new contributor go to find Derby/Apache coding guidelines 
such as our policies around copyright statements and @author tags? I 
would expect to find a link to these policies under the "Contribute Code 
or Documentation" section of the Community tab. But I don't see anything 
relevant there.

Thanks,
-Rick

Re: Coding guidelines

Posted by Satheesh Bandaram <sa...@Sourcery.Org>.
I thought Rick was asking about Apache/Derby specific guidelines and/or
policies. Anyway, Rick, you have seen Dan's posting. Copyright headers
being a requirement for ASL, I will have to wait for another patch... Sorry!

Satheesh

David W. Van Couvering wrote:

> 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.  We seem to be fairly
> inconsistent about everything else, although that said most of the
> code is fairly readable.
>
> David
>
> Rick Hillegas wrote:
>
>> Hm, let me try this again.
>>
>> Where would a new contributor go to find Derby/Apache coding
>> guidelines such as our policies around copyright statements and
>> @author tags? I would expect to find a link to these policies under
>> the "Contribute Code or Documentation" section of the Community tab.
>> But I don't see anything relevant there.
>>
>> Thanks,
>> -Rick
>


Re: Coding guidelines

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
"David W. Van Couvering" <Da...@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
indentation.

> 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


Re: Coding guidelines

Posted by "David W. Van Couvering" <Da...@Sun.COM>.
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.  We seem to be fairly 
inconsistent about everything else, although that said most of the code 
is fairly readable.

David

Rick Hillegas wrote:
> Hm, let me try this again.
> 
> Where would a new contributor go to find Derby/Apache coding guidelines 
> such as our policies around copyright statements and @author tags? I 
> would expect to find a link to these policies under the "Contribute Code 
> or Documentation" section of the Community tab. But I don't see anything 
> relevant there.
> 
> Thanks,
> -Rick