You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Toke Eskildsen <te...@statsbiblioteket.dk> on 2013/02/25 11:39:19 UTC

Line length in Lucene/Solr code

According to https://wiki.apache.org/solr/HowToContribute, Sun's code
style conventions should be used when writing contributions for Lucene
and Solr. Said conventions state that lines in code should be 80
characters or less, "since they're not handled well by many terminals
and tools":
http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html#313

A quick random inspection of the Lucene/Solr code base tells me that
this recommendation is not followed: Out of 20 source files, only a
single one adhered to the 80 characters/line limit and that was
StorageField, which is an interface.

I am all for a larger limit as I find that it makes Java code a lot more
readable. With current tools, Java code needs to be formatted using line
breaks and indents (as opposed to fully dynamic tool-specific re-flow of
the code). That formatting is dependent on a specific maximum line width
to be consistent.


With that in mind, I suggest that the code style recommendation is
expanded with the notion that a maximum of x characters/line should be
used, where x is something more than 80. Judging by a quick search, 120
chars seems to be a common choice.

Regards,
Toke Eskildsen


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Chris Hostetter <ho...@fucit.org>.
: I am all for a larger limit as I find that it makes Java code a lot more
: readable. With current tools, Java code needs to be formatted using line

    "Aim for 80 chars, but don't shoehorn things if they are 
     more readable on a single long line" 

               -Hoss'ss Law of Code Line Lengths



-Hoss

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Shawn Heisey <so...@elyograg.org>.
> I'd actually never bothered to look at the line limitation, that's from
> back when I started programming. Mostly I was just soooo happy that
> someone
> had short-circuited the endless "whether braces should be on the same line
> or not" discussion. <G>....
>
> P.S. the ''very'' is really an italic.
>
> P.P.S. Why programmers are different than the rest. Not _only_ have I been
> in the very "where should the braces go" discussions at various points in
> my life, but there's a Wiki article that's far too long....

For brace style, I believe that lucene currently uses 1TBS. Where I work,
we are expected to use Allman. Before starting here, I used 1TBS in my own
code. Allman is easiet to follow, vyt uses up a loy of vertical real
estate. I have no real opinion on whether brace style should change.  A
slightly different topic is whitespace on otherwise blank lines. There is
no consistency in Lucene here. I have no strong opinion one way or the
other, but I will note that the Eclipse format settings created by 'ant
eclipse' add the whitespace.

Getting back to the subject of this thread, I am torn. I use two programs
to edit Solr code -- vi and eclipse.  For vi (in PuTTY windows) 80 would
be best. For eclipse (in windows 7), something like 100 would be better. I
do not maximize program windows, because I like to see what's going on in
background windows. My eclipse window is large, but does not use the whole
1600x1050 area.

120 seems large, but it would work.

Thanks,
Shawn



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Erick Erickson <er...@gmail.com>.
I'd actually never bothered to look at the line limitation, that's from
back when I started programming. Mostly I was just soooo happy that someone
had short-circuited the endless "whether braces should be on the same line
or not" discussion. <G>....

P.S. the ''very'' is really an italic.

P.P.S. Why programmers are different than the rest. Not _only_ have I been
in the very "where should the braces go" discussions at various points in
my life, but there's a Wiki article that's far too long....

http://en.wikipedia.org/wiki/One_True_Brace_Style#K.26R_style


On Mon, Feb 25, 2013 at 9:55 AM, Erick Erickson <er...@gmail.com>wrote:

> Changed to:
> lines can be greater than 80 chars long, 132 is a common limit. Try to be
> reasonable for ''very'' long lines.
>
>
> On Mon, Feb 25, 2013 at 9:51 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
>
>> Hi,
>>
>> One interesting detail: The "old style" terminal width of IBM PC's with
>> 80 columns used in the Java line length migrated in the meantime to another
>> "common" line length: Most terminal applications have a default length of
>> e.g. 132 already - so I would make this number (around 130) the "most
>> common" standard! Interestingly, the avg line length of Lucene code is
>> already smaller!
>>
>> Uwe
>>
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>>
>> > -----Original Message-----
>> > From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
>> > Sent: Monday, February 25, 2013 11:39 AM
>> > To: dev@lucene.apache.org
>> > Subject: Line length in Lucene/Solr code
>> >
>> > According to https://wiki.apache.org/solr/HowToContribute, Sun's code
>> style
>> > conventions should be used when writing contributions for Lucene and
>> Solr.
>> > Said conventions state that lines in code should be 80 characters or
>> less,
>> > "since they're not handled well by many terminals and tools":
>> > http://www.oracle.com/technetwork/java/javase/documentation/codecon
>> > ventions-136091.html#313
>> >
>> > A quick random inspection of the Lucene/Solr code base tells me that
>> this
>> > recommendation is not followed: Out of 20 source files, only a single
>> one
>> > adhered to the 80 characters/line limit and that was StorageField,
>> which is an
>> > interface.
>> >
>> > I am all for a larger limit as I find that it makes Java code a lot
>> more readable.
>> > With current tools, Java code needs to be formatted using line breaks
>> and
>> > indents (as opposed to fully dynamic tool-specific re-flow of the
>> code). That
>> > formatting is dependent on a specific maximum line width to be
>> consistent.
>> >
>> >
>> > With that in mind, I suggest that the code style recommendation is
>> expanded
>> > with the notion that a maximum of x characters/line should be used,
>> where x
>> > is something more than 80. Judging by a quick search, 120 chars seems
>> to be
>> > a common choice.
>> >
>> > Regards,
>> > Toke Eskildsen
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For
>> additional
>> > commands, e-mail: dev-help@lucene.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>>
>

Re: Line length in Lucene/Solr code

Posted by Erick Erickson <er...@gmail.com>.
Changed to:
lines can be greater than 80 chars long, 132 is a common limit. Try to be
reasonable for ''very'' long lines.


On Mon, Feb 25, 2013 at 9:51 AM, Uwe Schindler <uw...@thetaphi.de> wrote:

> Hi,
>
> One interesting detail: The "old style" terminal width of IBM PC's with 80
> columns used in the Java line length migrated in the meantime to another
> "common" line length: Most terminal applications have a default length of
> e.g. 132 already - so I would make this number (around 130) the "most
> common" standard! Interestingly, the avg line length of Lucene code is
> already smaller!
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
> > -----Original Message-----
> > From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
> > Sent: Monday, February 25, 2013 11:39 AM
> > To: dev@lucene.apache.org
> > Subject: Line length in Lucene/Solr code
> >
> > According to https://wiki.apache.org/solr/HowToContribute, Sun's code
> style
> > conventions should be used when writing contributions for Lucene and
> Solr.
> > Said conventions state that lines in code should be 80 characters or
> less,
> > "since they're not handled well by many terminals and tools":
> > http://www.oracle.com/technetwork/java/javase/documentation/codecon
> > ventions-136091.html#313
> >
> > A quick random inspection of the Lucene/Solr code base tells me that this
> > recommendation is not followed: Out of 20 source files, only a single one
> > adhered to the 80 characters/line limit and that was StorageField, which
> is an
> > interface.
> >
> > I am all for a larger limit as I find that it makes Java code a lot more
> readable.
> > With current tools, Java code needs to be formatted using line breaks and
> > indents (as opposed to fully dynamic tool-specific re-flow of the code).
> That
> > formatting is dependent on a specific maximum line width to be
> consistent.
> >
> >
> > With that in mind, I suggest that the code style recommendation is
> expanded
> > with the notion that a maximum of x characters/line should be used,
> where x
> > is something more than 80. Judging by a quick search, 120 chars seems to
> be
> > a common choice.
> >
> > Regards,
> > Toke Eskildsen
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> > commands, e-mail: dev-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

RE: Line length in Lucene/Solr code

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

One interesting detail: The "old style" terminal width of IBM PC's with 80 columns used in the Java line length migrated in the meantime to another "common" line length: Most terminal applications have a default length of e.g. 132 already - so I would make this number (around 130) the "most common" standard! Interestingly, the avg line length of Lucene code is already smaller!

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
> Sent: Monday, February 25, 2013 11:39 AM
> To: dev@lucene.apache.org
> Subject: Line length in Lucene/Solr code
> 
> According to https://wiki.apache.org/solr/HowToContribute, Sun's code style
> conventions should be used when writing contributions for Lucene and Solr.
> Said conventions state that lines in code should be 80 characters or less,
> "since they're not handled well by many terminals and tools":
> http://www.oracle.com/technetwork/java/javase/documentation/codecon
> ventions-136091.html#313
> 
> A quick random inspection of the Lucene/Solr code base tells me that this
> recommendation is not followed: Out of 20 source files, only a single one
> adhered to the 80 characters/line limit and that was StorageField, which is an
> interface.
> 
> I am all for a larger limit as I find that it makes Java code a lot more readable.
> With current tools, Java code needs to be formatted using line breaks and
> indents (as opposed to fully dynamic tool-specific re-flow of the code). That
> formatting is dependent on a specific maximum line width to be consistent.
> 
> 
> With that in mind, I suggest that the code style recommendation is expanded
> with the notion that a maximum of x characters/line should be used, where x
> is something more than 80. Judging by a quick search, 120 chars seems to be
> a common choice.
> 
> Regards,
> Toke Eskildsen
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: Line length in Lucene/Solr code

Posted by "David Smiley (@MITRE.org)" <DS...@mitre.org>.
If 120 is the new maximum, is it also the generally recommended
reflow/line-break for javadocs?  Or should that be 100, or stay at 80?  I
suggest 100.

~ David



-----
 Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: http://lucene.472066.n3.nabble.com/Line-length-in-Lucene-Solr-code-tp4042685p4042849.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Shai Erera <se...@gmail.com>.
+1

Shai


On Mon, Feb 25, 2013 at 1:01 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> +1
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
>
> On Mon, Feb 25, 2013 at 5:59 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> > +1 to raise the default of 80 to a minimum of 120. I really hate short
> lines (and I find that the longer lines are much more readable) :-)
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >> -----Original Message-----
> >> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
> >> Sent: Monday, February 25, 2013 11:39 AM
> >> To: dev@lucene.apache.org
> >> Subject: Line length in Lucene/Solr code
> >>
> >> According to https://wiki.apache.org/solr/HowToContribute, Sun's code
> style
> >> conventions should be used when writing contributions for Lucene and
> Solr.
> >> Said conventions state that lines in code should be 80 characters or
> less,
> >> "since they're not handled well by many terminals and tools":
> >> http://www.oracle.com/technetwork/java/javase/documentation/codecon
> >> ventions-136091.html#313
> >>
> >> A quick random inspection of the Lucene/Solr code base tells me that
> this
> >> recommendation is not followed: Out of 20 source files, only a single
> one
> >> adhered to the 80 characters/line limit and that was StorageField,
> which is an
> >> interface.
> >>
> >> I am all for a larger limit as I find that it makes Java code a lot
> more readable.
> >> With current tools, Java code needs to be formatted using line breaks
> and
> >> indents (as opposed to fully dynamic tool-specific re-flow of the
> code). That
> >> formatting is dependent on a specific maximum line width to be
> consistent.
> >>
> >>
> >> With that in mind, I suggest that the code style recommendation is
> expanded
> >> with the notion that a maximum of x characters/line should be used,
> where x
> >> is something more than 80. Judging by a quick search, 120 chars seems
> to be
> >> a common choice.
> >>
> >> Regards,
> >> Toke Eskildsen
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For
> additional
> >> commands, e-mail: dev-help@lucene.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: dev-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Line length in Lucene/Solr code

Posted by Jan Høydahl <ja...@cominvent.com>.
+1
--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

25. feb. 2013 kl. 13:37 skrev Simon Willnauer <si...@gmail.com>:

> +1
> 
> On Mon, Feb 25, 2013 at 12:05 PM, Christian Moen <cm...@atilika.com> wrote:
>> +1
>> 
>> Christian Moen
>> http://www.atilika.com
>> 
>> On Feb 25, 2013, at 8:01 PM, Michael McCandless <lu...@mikemccandless.com> wrote:
>> 
>>> +1
>>> 
>>> Mike McCandless
>>> 
>>> http://blog.mikemccandless.com
>>> 
>>> 
>>> On Mon, Feb 25, 2013 at 5:59 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
>>>> +1 to raise the default of 80 to a minimum of 120. I really hate short lines (and I find that the longer lines are much more readable) :-)
>>>> 
>>>> -----
>>>> Uwe Schindler
>>>> H.-H.-Meier-Allee 63, D-28213 Bremen
>>>> http://www.thetaphi.de
>>>> eMail: uwe@thetaphi.de
>>>> 
>>>>> -----Original Message-----
>>>>> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
>>>>> Sent: Monday, February 25, 2013 11:39 AM
>>>>> To: dev@lucene.apache.org
>>>>> Subject: Line length in Lucene/Solr code
>>>>> 
>>>>> According to https://wiki.apache.org/solr/HowToContribute, Sun's code style
>>>>> conventions should be used when writing contributions for Lucene and Solr.
>>>>> Said conventions state that lines in code should be 80 characters or less,
>>>>> "since they're not handled well by many terminals and tools":
>>>>> http://www.oracle.com/technetwork/java/javase/documentation/codecon
>>>>> ventions-136091.html#313
>>>>> 
>>>>> A quick random inspection of the Lucene/Solr code base tells me that this
>>>>> recommendation is not followed: Out of 20 source files, only a single one
>>>>> adhered to the 80 characters/line limit and that was StorageField, which is an
>>>>> interface.
>>>>> 
>>>>> I am all for a larger limit as I find that it makes Java code a lot more readable.
>>>>> With current tools, Java code needs to be formatted using line breaks and
>>>>> indents (as opposed to fully dynamic tool-specific re-flow of the code). That
>>>>> formatting is dependent on a specific maximum line width to be consistent.
>>>>> 
>>>>> 
>>>>> With that in mind, I suggest that the code style recommendation is expanded
>>>>> with the notion that a maximum of x characters/line should be used, where x
>>>>> is something more than 80. Judging by a quick search, 120 chars seems to be
>>>>> a common choice.
>>>>> 
>>>>> Regards,
>>>>> Toke Eskildsen
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
>>>>> commands, e-mail: dev-help@lucene.apache.org
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>>>> For additional commands, e-mail: dev-help@lucene.apache.org
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: dev-help@lucene.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Simon Willnauer <si...@gmail.com>.
+1

On Mon, Feb 25, 2013 at 12:05 PM, Christian Moen <cm...@atilika.com> wrote:
> +1
>
> Christian Moen
> http://www.atilika.com
>
> On Feb 25, 2013, at 8:01 PM, Michael McCandless <lu...@mikemccandless.com> wrote:
>
>> +1
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>>
>> On Mon, Feb 25, 2013 at 5:59 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
>>> +1 to raise the default of 80 to a minimum of 120. I really hate short lines (and I find that the longer lines are much more readable) :-)
>>>
>>> -----
>>> Uwe Schindler
>>> H.-H.-Meier-Allee 63, D-28213 Bremen
>>> http://www.thetaphi.de
>>> eMail: uwe@thetaphi.de
>>>
>>>> -----Original Message-----
>>>> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
>>>> Sent: Monday, February 25, 2013 11:39 AM
>>>> To: dev@lucene.apache.org
>>>> Subject: Line length in Lucene/Solr code
>>>>
>>>> According to https://wiki.apache.org/solr/HowToContribute, Sun's code style
>>>> conventions should be used when writing contributions for Lucene and Solr.
>>>> Said conventions state that lines in code should be 80 characters or less,
>>>> "since they're not handled well by many terminals and tools":
>>>> http://www.oracle.com/technetwork/java/javase/documentation/codecon
>>>> ventions-136091.html#313
>>>>
>>>> A quick random inspection of the Lucene/Solr code base tells me that this
>>>> recommendation is not followed: Out of 20 source files, only a single one
>>>> adhered to the 80 characters/line limit and that was StorageField, which is an
>>>> interface.
>>>>
>>>> I am all for a larger limit as I find that it makes Java code a lot more readable.
>>>> With current tools, Java code needs to be formatted using line breaks and
>>>> indents (as opposed to fully dynamic tool-specific re-flow of the code). That
>>>> formatting is dependent on a specific maximum line width to be consistent.
>>>>
>>>>
>>>> With that in mind, I suggest that the code style recommendation is expanded
>>>> with the notion that a maximum of x characters/line should be used, where x
>>>> is something more than 80. Judging by a quick search, 120 chars seems to be
>>>> a common choice.
>>>>
>>>> Regards,
>>>> Toke Eskildsen
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
>>>> commands, e-mail: dev-help@lucene.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: dev-help@lucene.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Christian Moen <cm...@atilika.com>.
+1

Christian Moen
http://www.atilika.com

On Feb 25, 2013, at 8:01 PM, Michael McCandless <lu...@mikemccandless.com> wrote:

> +1
> 
> Mike McCandless
> 
> http://blog.mikemccandless.com
> 
> 
> On Mon, Feb 25, 2013 at 5:59 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
>> +1 to raise the default of 80 to a minimum of 120. I really hate short lines (and I find that the longer lines are much more readable) :-)
>> 
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>> 
>>> -----Original Message-----
>>> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
>>> Sent: Monday, February 25, 2013 11:39 AM
>>> To: dev@lucene.apache.org
>>> Subject: Line length in Lucene/Solr code
>>> 
>>> According to https://wiki.apache.org/solr/HowToContribute, Sun's code style
>>> conventions should be used when writing contributions for Lucene and Solr.
>>> Said conventions state that lines in code should be 80 characters or less,
>>> "since they're not handled well by many terminals and tools":
>>> http://www.oracle.com/technetwork/java/javase/documentation/codecon
>>> ventions-136091.html#313
>>> 
>>> A quick random inspection of the Lucene/Solr code base tells me that this
>>> recommendation is not followed: Out of 20 source files, only a single one
>>> adhered to the 80 characters/line limit and that was StorageField, which is an
>>> interface.
>>> 
>>> I am all for a larger limit as I find that it makes Java code a lot more readable.
>>> With current tools, Java code needs to be formatted using line breaks and
>>> indents (as opposed to fully dynamic tool-specific re-flow of the code). That
>>> formatting is dependent on a specific maximum line width to be consistent.
>>> 
>>> 
>>> With that in mind, I suggest that the code style recommendation is expanded
>>> with the notion that a maximum of x characters/line should be used, where x
>>> is something more than 80. Judging by a quick search, 120 chars seems to be
>>> a common choice.
>>> 
>>> Regards,
>>> Toke Eskildsen
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
>>> commands, e-mail: dev-help@lucene.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Line length in Lucene/Solr code

Posted by Michael McCandless <lu...@mikemccandless.com>.
+1

Mike McCandless

http://blog.mikemccandless.com


On Mon, Feb 25, 2013 at 5:59 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> +1 to raise the default of 80 to a minimum of 120. I really hate short lines (and I find that the longer lines are much more readable) :-)
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>> -----Original Message-----
>> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
>> Sent: Monday, February 25, 2013 11:39 AM
>> To: dev@lucene.apache.org
>> Subject: Line length in Lucene/Solr code
>>
>> According to https://wiki.apache.org/solr/HowToContribute, Sun's code style
>> conventions should be used when writing contributions for Lucene and Solr.
>> Said conventions state that lines in code should be 80 characters or less,
>> "since they're not handled well by many terminals and tools":
>> http://www.oracle.com/technetwork/java/javase/documentation/codecon
>> ventions-136091.html#313
>>
>> A quick random inspection of the Lucene/Solr code base tells me that this
>> recommendation is not followed: Out of 20 source files, only a single one
>> adhered to the 80 characters/line limit and that was StorageField, which is an
>> interface.
>>
>> I am all for a larger limit as I find that it makes Java code a lot more readable.
>> With current tools, Java code needs to be formatted using line breaks and
>> indents (as opposed to fully dynamic tool-specific re-flow of the code). That
>> formatting is dependent on a specific maximum line width to be consistent.
>>
>>
>> With that in mind, I suggest that the code style recommendation is expanded
>> with the notion that a maximum of x characters/line should be used, where x
>> is something more than 80. Judging by a quick search, 120 chars seems to be
>> a common choice.
>>
>> Regards,
>> Toke Eskildsen
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
>> commands, e-mail: dev-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: Line length in Lucene/Solr code

Posted by Uwe Schindler <uw...@thetaphi.de>.
+1 to raise the default of 80 to a minimum of 120. I really hate short lines (and I find that the longer lines are much more readable) :-)

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Toke Eskildsen [mailto:te@statsbiblioteket.dk]
> Sent: Monday, February 25, 2013 11:39 AM
> To: dev@lucene.apache.org
> Subject: Line length in Lucene/Solr code
> 
> According to https://wiki.apache.org/solr/HowToContribute, Sun's code style
> conventions should be used when writing contributions for Lucene and Solr.
> Said conventions state that lines in code should be 80 characters or less,
> "since they're not handled well by many terminals and tools":
> http://www.oracle.com/technetwork/java/javase/documentation/codecon
> ventions-136091.html#313
> 
> A quick random inspection of the Lucene/Solr code base tells me that this
> recommendation is not followed: Out of 20 source files, only a single one
> adhered to the 80 characters/line limit and that was StorageField, which is an
> interface.
> 
> I am all for a larger limit as I find that it makes Java code a lot more readable.
> With current tools, Java code needs to be formatted using line breaks and
> indents (as opposed to fully dynamic tool-specific re-flow of the code). That
> formatting is dependent on a specific maximum line width to be consistent.
> 
> 
> With that in mind, I suggest that the code style recommendation is expanded
> with the notion that a maximum of x characters/line should be used, where x
> is something more than 80. Judging by a quick search, 120 chars seems to be
> a common choice.
> 
> Regards,
> Toke Eskildsen
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org