Jukka Zitting wrote:
> 
> Hi,
> 
> On 9/21/07, Chris A. Mattmann (JIRA) <[EMAIL PROTECTED]> wrote:
>> As an FYI: do we want to adopt the Sun convention across the board here?
>> What do others think?
> 
> I'd prefer Sun conventions (with spaces instead of tabs for indentation).
> 
> BR,
> 
> Jukka Zitting
> 
> 

All -

Here are my opinions, for what they're worth...

BTW, the Sun coding conventions can be found at
http://java.sun.com/docs/codeconv/CodeConventions.pdf.

I think that on the whole, the Sun conventions are excellent.


--- Exceptions ---

1) (Already mentioned by Jukka) Contrary to Sun's recommendation, tabs
should not be used for indentation.  I wholeheartedly agree.  My suggestion
would be to ban tabs altogether, except in string literals, where they would
be represented as "\t".

2) I believe we need to make an exception to Section 3.1.1, which says that
the author's name should be included.  (The example does not include author
names, but the descriptive text does.)  I believe we've decided not to
include author names.


--- Clarify? ---

3) Section 4.2 Wrapping lines:  Breaking before an operator includes the dot
operator, right?  As in:

   .......................................foo(bar
       .someReallyReallyReallyReallyLongMethodName())



--- I Will Conform If Necessary, But Here's My Peeve ---

I realize it would not be a good idea to spend time debating minor points,
but I figured I'd mention these just in case there is a consensus to allow
these exceptions.

4) 6.2 includes "Don’t wait to declare variables until their first use".  I
believe that the code is clearer when one *does* wait until their first use
because doing so:

a) eliminates the need for an additional unnecessarily verbose line and
possibly initialization.

b) communicates more information to the reader, namely that the variable is
not used until the point at which it is declared/initialized.


5) Section 8.1, Methods should be separated by only 1 blank line between
methods:  Vertical space is one of the tools we have to communicate.  The
amount of vertical space can be used to communicate the degree of connection
or separateness.  Single lines are appropriate within methods to separate
sections (even better to have smaller methods that don't need this).  I use
two lines between methods to more clearly indicate to the reader the
boundary between methods.

Regards,
Keith

-- 
View this message in context: 
http://www.nabble.com/Tika-coding-style-%28Was%3A--jira--Commented%3A-%28TIKA-6%29-Port-Nutch-%28or-better%29-MimeType-detection-system-into-Tika%29-tf4496520.html#a12824320
Sent from the Apache Tika - Development mailing list archive at Nabble.com.

Reply via email to