lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/search Hits.java QueryFilter.java
Date Sat, 13 Sep 2003 21:11:17 GMT
I've said this stuff before:

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-dev@jakarta.apache.org&msgNo=2411
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-dev@jakarta.apache.org&msgId=477032

I indent things using two spaces.  I mostly adhere to Sun's style 
guidelines.  However, there's a tension there between the 
four-spaces-per-indent-level rule and the 80-columns rule.  Unlike most 
Java programmers, I choose to obey the 80-column rule.  I edit in an 
80-column wide Emacs window, and don't like wrapped lines.  Indenting 2 
spaces makes this workable.  I also just like the way 2-space indenting 
looks.  Call me crazy and anti-social.

We should be tolerant of other coding styles.  Lots of folks put opening 
brackets on separate lines, prefix field names with underscores or 'm', 
have 120 column lines, and other things that I would never do.  I think 
it is rude to re-indent or otherwise re-style a whole file, unless it is 
unlikely that the original author will ever edit it again.  I think it 
is polite, if you make a one or two line change, to make it in the 
file's existing style.  For larger changes, say ten lines or so, I think 
it is fine to use a different style than that used in the rest of the 
file.  If you do a major re-write, then re-indenting is fine.  Styles, 
like accents in spoken language, give code character.  There is no 
univerally acceptable style.  Unless something is unintelligable, we 
needn't re-state it.

Doug

Erik Hatcher wrote:
> On Saturday, September 13, 2003, at 06:46  AM, ehatcher@apache.org wrote:
> 
>>   Reformatted.  Do we have any style guides special to Lucene 
>> different than Jakarta standards?
> 
> 
> I'm doing some thorough looks at Lucene's source code and its helpful to 
> me to reformat the files with 4 space indents rather than the usual 2 I 
> see.  Are there specific style guidelines Lucene is following in 
> contrast to the semi-official Jakarta ones?
> 
> Also, one-line blocks without curly brackets drives me nuts!  :)  Is it 
> ok for me to put them around statements like this:
> 
>     if (condition)
>         doSomething();
> 
> ??
> 
> I went ahead and did reformatting to a couple of files, and I'm not 
> planning on doing it globally, but just as I encounter them.  I wanted 
> to check on this before potentially doing others similarly.
> 
>     Erik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


Mime
View raw message