You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by Rich Haase <rh...@pandora.com> on 2015/05/05 20:05:18 UTC

Checkstyle 80 char limit

Can someone explain to me why on earth we care about limiting line length to 80 characters?  Are there hadoop developers out there working from teletype terminals?  Can we perhaps update this limit to something sane, like 120 chars?



Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>




Re: Checkstyle 80 char limit

Posted by Rich Haase <rh...@pandora.com>.
Thanks for sharing that links Steve!

On May 6, 2015, at 3:45 AM, Steve Loughran <st...@hortonworks.com>> wrote:



I find it restrictive too, but recognise why it is so critical for side-by-side patch review

grab this plugin to browse JIRA patches and then you'll really appreciate it.

 https://chrome.google.com/webstore/detail/git-patch-viewer/hkoggakcdopbgnaeeidcmopfekipkleg

Similarly, it's good for IntelliJ's compare-with feature, which shows your live window next to the latest SCM version or another branch, lets you pull in lines, delete lines, .... Above 100+ chars this becomes unworkable except on a 25" + wide-screen monitor

regarding style guides -you know I'm working on a new one?

 https://github.com/steveloughran/formality/blob/master/styleguide/styleguide.md

it's something I'm expanding during test runs, not yet ready for wide review

Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com>





Re: Checkstyle 80 char limit

Posted by Steve Loughran <st...@hortonworks.com>.

I find it restrictive too, but recognise why it is so critical for side-by-side patch review

grab this plugin to browse JIRA patches and then you'll really appreciate it.

  https://chrome.google.com/webstore/detail/git-patch-viewer/hkoggakcdopbgnaeeidcmopfekipkleg

Similarly, it's good for IntelliJ's compare-with feature, which shows your live window next to the latest SCM version or another branch, lets you pull in lines, delete lines, .... Above 100+ chars this becomes unworkable except on a 25" + wide-screen monitor

regarding style guides -you know I'm working on a new one?

  https://github.com/steveloughran/formality/blob/master/styleguide/styleguide.md

it's something I'm expanding during test runs, not yet ready for wide review

Re: Checkstyle 80 char limit

Posted by Andrew Wang <an...@cloudera.com>.
I typically split my IDE into two side-by-side panes, the 80 char limit
works pretty well once you factor in the side panes too. I've worked on a
project with a 100 char limit, and that's about the point where even my 30"
monitor needs side scrolling.

I think Colin pretty much nailed it with his reasons. We need some limit,
very wide lines hurt readability, if you run into issues consider
refactoring your code. I've had annoyances with long variable or method
names, but nothing so egregious that makes me want to up it from 80 (and I
have reviewed some code in distcp too). I use the autoformatter in my IDE
and let the magic happen.

Best,
Andrew

On Tue, May 5, 2015 at 3:46 PM, Rich Haase <rh...@pandora.com> wrote:

> Jay,
>
> Does bigtop use a line length limit at all?   I was mostly hoping that we
> could update to using a limit that was more appropriate (IMO) to modern
> IDEs, like 100-120 chars perhaps?
>
>
> On May 5, 2015, at 4:38 PM, jay vyas <jayunit100.apache@gmail.com<mailto:
> jayunit100.apache@gmail.com>> wrote:
>
> im glad you've started this thread.
>
> 1) i like the idea of dropping the 80 char limit !
>
> 2) and indeed, we've now adopted it in ASF BigTop, where we try to take
> queues from hadoop when possible.
>
> On Tue, May 5, 2015 at 3:53 PM, Rich Haase <rhaase@pandora.com<mailto:
> rhaase@pandora.com>> wrote:
>
> Arun,
>
> I use my IDE split vertically all the time on projects without strict line
> limits and I have never had a problem seeing the code from multiple classes
> in such a setup.
>
> I can certainly setup my IDE to only do 80 characters a line, although I
> think it hurts readability in many cases where long names force method
> calls to wrap across many lines.  The reason I initially asked about the
> line length limit being so low is that I am having to reformat a quite a
> bit of the distcp code in order to submit a patch.  It’s clear to me that
> distcp did not follow the code standards being checked by checkstyle.
> While I don’t mind refactoring code to meet a standard I think that
> standard should reflect the state of development environments used this
> decade.
>
> Rich
>
> On May 5, 2015, at 1:36 PM, Arun Suresh <asuresh@cloudera.com<mailto:
> asuresh@cloudera.com><mailto:
> asuresh@cloudera.com<ma...@cloudera.com>>> wrote:
>
> My 2 cents :
> I actually like the lower char limit. Since most of the time, I end up
> having to switch between classes, I end up splitting my screen vertically
> and having multiple files open. for some reason, I find splitting
> vertically is better for readability than horizontally.
> In anycase, my IDE generally helps me format to 80 chars so, it has never
> been a pain point for me.
>
> On Tue, May 5, 2015 at 12:30 PM, Niels Basjes <Niels@basjes.nl<mailto:
> Niels@basjes.nl><mailto:
> Niels@basjes.nl<ma...@basjes.nl>>> wrote:
>
> I respect immensely the contributions Doug has made to many Apache
> projects,
>
> Hear hear! I fully agree with that one.
>
> On Tue, May 5, 2015 at 8:30 PM, Rich Haase <rhaase@pandora.com<mailto:
> rhaase@pandora.com><mailto:
> rhaase@pandora.com<ma...@pandora.com>>> wrote:
>
> I respect immensely the contributions Doug has made to many Apache
> projects, but I don’t think that should be a reason to force everyone to
> write code as if our screen sizes can’t support more than 80 characters.
>
> On May 5, 2015, at 12:21 PM, Niels Basjes <Niels@basjes.nl<mailto:
> Niels@basjes.nl><mailto:
> Niels@basjes.nl<ma...@basjes.nl>><mailto:
> Niels@basjes.nl<ma...@basjes.nl>>> wrote:
>
> Perhaps we should tell him these screens can also be turned landscape ?
> ;)
>
> But seriously:
> 1) Does Doug still actively work on code? From my perspective; Only very
> infrequently.
> 2) In the 200+ people IT department where I work I know only 1 colleague
> who uses his screen in portrait mode and he doesn't do code.
>
> So, for who do we really stick to the 80 chars limit?
>
> Niels
>
> On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw@altiscale.com<mailto:
> aw@altiscale.com><mailto:
> aw@altiscale.com<ma...@altiscale.com>>
> <mailto:
> aw@altiscale.com<ma...@altiscale.com>>>
> wrote:
>
>
> On May 5, 2015, at 11:05 AM, Rich Haase <rhaase@pandora.com<mailto:
> rhaase@pandora.com><mailto:
> rhaase@pandora.com<ma...@pandora.com>><mailto:
> rhaase@pandora.com<ma...@pandora.com>>>
> wrote:
>
> Can someone explain to me why on earth we care about limiting line
> length to 80 characters?  Are there hadoop developers out there working
> from teletype terminals?  Can we perhaps update this limit to something
> sane, like 120 chars?
>
>
>
>
>
>
>
>
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
>
>
>
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>
> Rich Haase| Sr. Software Engineer | Pandora
> m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com><mailto:
> awilson2@pandora.com>
>
>
>
>
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>
>
> Rich Haase| Sr. Software Engineer | Pandora
> m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com><mailto:
> rhaase@pandora.com>
>
>
>
>
>
>
>
> --
> jay vyas
>
> Rich Haase| Sr. Software Engineer | Pandora
> m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com>
>
>
>
>
>

Re: Checkstyle 80 char limit

Posted by Rich Haase <rh...@pandora.com>.
Jay,

Does bigtop use a line length limit at all?   I was mostly hoping that we could update to using a limit that was more appropriate (IMO) to modern IDEs, like 100-120 chars perhaps?


On May 5, 2015, at 4:38 PM, jay vyas <ja...@gmail.com>> wrote:

im glad you've started this thread.

1) i like the idea of dropping the 80 char limit !

2) and indeed, we've now adopted it in ASF BigTop, where we try to take
queues from hadoop when possible.

On Tue, May 5, 2015 at 3:53 PM, Rich Haase <rh...@pandora.com>> wrote:

Arun,

I use my IDE split vertically all the time on projects without strict line
limits and I have never had a problem seeing the code from multiple classes
in such a setup.

I can certainly setup my IDE to only do 80 characters a line, although I
think it hurts readability in many cases where long names force method
calls to wrap across many lines.  The reason I initially asked about the
line length limit being so low is that I am having to reformat a quite a
bit of the distcp code in order to submit a patch.  It’s clear to me that
distcp did not follow the code standards being checked by checkstyle.
While I don’t mind refactoring code to meet a standard I think that
standard should reflect the state of development environments used this
decade.

Rich

On May 5, 2015, at 1:36 PM, Arun Suresh <as...@cloudera.com><mailto:
asuresh@cloudera.com<ma...@cloudera.com>>> wrote:

My 2 cents :
I actually like the lower char limit. Since most of the time, I end up
having to switch between classes, I end up splitting my screen vertically
and having multiple files open. for some reason, I find splitting
vertically is better for readability than horizontally.
In anycase, my IDE generally helps me format to 80 chars so, it has never
been a pain point for me.

On Tue, May 5, 2015 at 12:30 PM, Niels Basjes <Ni...@basjes.nl><mailto:
Niels@basjes.nl<ma...@basjes.nl>>> wrote:

I respect immensely the contributions Doug has made to many Apache
projects,

Hear hear! I fully agree with that one.

On Tue, May 5, 2015 at 8:30 PM, Rich Haase <rh...@pandora.com><mailto:
rhaase@pandora.com<ma...@pandora.com>>> wrote:

I respect immensely the contributions Doug has made to many Apache
projects, but I don’t think that should be a reason to force everyone to
write code as if our screen sizes can’t support more than 80 characters.

On May 5, 2015, at 12:21 PM, Niels Basjes <Ni...@basjes.nl><mailto:
Niels@basjes.nl<ma...@basjes.nl>><mailto:
Niels@basjes.nl<ma...@basjes.nl>>> wrote:

Perhaps we should tell him these screens can also be turned landscape ?
;)

But seriously:
1) Does Doug still actively work on code? From my perspective; Only very
infrequently.
2) In the 200+ people IT department where I work I know only 1 colleague
who uses his screen in portrait mode and he doesn't do code.

So, for who do we really stick to the 80 chars limit?

Niels

On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw...@altiscale.com><mailto:
aw@altiscale.com<ma...@altiscale.com>>
<mailto:
aw@altiscale.com<ma...@altiscale.com>>> wrote:


On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com><mailto:
rhaase@pandora.com<ma...@pandora.com>><mailto:
rhaase@pandora.com<ma...@pandora.com>>> wrote:

Can someone explain to me why on earth we care about limiting line
length to 80 characters?  Are there hadoop developers out there working
from teletype terminals?  Can we perhaps update this limit to something
sane, like 120 chars?







http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E





--
Best regards / Met vriendelijke groeten,

Niels Basjes

Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>






--
Best regards / Met vriendelijke groeten,

Niels Basjes


Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com>







--
jay vyas

Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com>





Re: Checkstyle 80 char limit

Posted by jay vyas <ja...@gmail.com>.
im glad you've started this thread.

1) i like the idea of dropping the 80 char limit !

2) and indeed, we've now adopted it in ASF BigTop, where we try to take
queues from hadoop when possible.

On Tue, May 5, 2015 at 3:53 PM, Rich Haase <rh...@pandora.com> wrote:

> Arun,
>
> I use my IDE split vertically all the time on projects without strict line
> limits and I have never had a problem seeing the code from multiple classes
> in such a setup.
>
> I can certainly setup my IDE to only do 80 characters a line, although I
> think it hurts readability in many cases where long names force method
> calls to wrap across many lines.  The reason I initially asked about the
> line length limit being so low is that I am having to reformat a quite a
> bit of the distcp code in order to submit a patch.  It’s clear to me that
> distcp did not follow the code standards being checked by checkstyle.
> While I don’t mind refactoring code to meet a standard I think that
> standard should reflect the state of development environments used this
> decade.
>
> Rich
>
> On May 5, 2015, at 1:36 PM, Arun Suresh <asuresh@cloudera.com<mailto:
> asuresh@cloudera.com>> wrote:
>
> My 2 cents :
> I actually like the lower char limit. Since most of the time, I end up
> having to switch between classes, I end up splitting my screen vertically
> and having multiple files open. for some reason, I find splitting
> vertically is better for readability than horizontally.
> In anycase, my IDE generally helps me format to 80 chars so, it has never
> been a pain point for me.
>
> On Tue, May 5, 2015 at 12:30 PM, Niels Basjes <Niels@basjes.nl<mailto:
> Niels@basjes.nl>> wrote:
>
> I respect immensely the contributions Doug has made to many Apache
> projects,
>
> Hear hear! I fully agree with that one.
>
> On Tue, May 5, 2015 at 8:30 PM, Rich Haase <rhaase@pandora.com<mailto:
> rhaase@pandora.com>> wrote:
>
> I respect immensely the contributions Doug has made to many Apache
> projects, but I don’t think that should be a reason to force everyone to
> write code as if our screen sizes can’t support more than 80 characters.
>
> On May 5, 2015, at 12:21 PM, Niels Basjes <Niels@basjes.nl<mailto:
> Niels@basjes.nl><mailto:
> Niels@basjes.nl<ma...@basjes.nl>>> wrote:
>
> Perhaps we should tell him these screens can also be turned landscape ?
> ;)
>
> But seriously:
> 1) Does Doug still actively work on code? From my perspective; Only very
> infrequently.
> 2) In the 200+ people IT department where I work I know only 1 colleague
> who uses his screen in portrait mode and he doesn't do code.
>
> So, for who do we really stick to the 80 chars limit?
>
> Niels
>
> On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw@altiscale.com<mailto:
> aw@altiscale.com>
> <mailto:
> aw@altiscale.com<ma...@altiscale.com>>> wrote:
>
>
> On May 5, 2015, at 11:05 AM, Rich Haase <rhaase@pandora.com<mailto:
> rhaase@pandora.com><mailto:
> rhaase@pandora.com<ma...@pandora.com>>> wrote:
>
> Can someone explain to me why on earth we care about limiting line
> length to 80 characters?  Are there hadoop developers out there working
> from teletype terminals?  Can we perhaps update this limit to something
> sane, like 120 chars?
>
>
>
>
>
>
>
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
>
>
>
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>
> Rich Haase| Sr. Software Engineer | Pandora
> m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>
>
>
>
>
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>
>
> Rich Haase| Sr. Software Engineer | Pandora
> m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com>
>
>
>
>
>


-- 
jay vyas

Re: Checkstyle 80 char limit

Posted by Rich Haase <rh...@pandora.com>.
Arun,

I use my IDE split vertically all the time on projects without strict line limits and I have never had a problem seeing the code from multiple classes in such a setup.

I can certainly setup my IDE to only do 80 characters a line, although I think it hurts readability in many cases where long names force method calls to wrap across many lines.  The reason I initially asked about the line length limit being so low is that I am having to reformat a quite a bit of the distcp code in order to submit a patch.  It’s clear to me that distcp did not follow the code standards being checked by checkstyle.  While I don’t mind refactoring code to meet a standard I think that standard should reflect the state of development environments used this decade.

Rich

On May 5, 2015, at 1:36 PM, Arun Suresh <as...@cloudera.com>> wrote:

My 2 cents :
I actually like the lower char limit. Since most of the time, I end up
having to switch between classes, I end up splitting my screen vertically
and having multiple files open. for some reason, I find splitting
vertically is better for readability than horizontally.
In anycase, my IDE generally helps me format to 80 chars so, it has never
been a pain point for me.

On Tue, May 5, 2015 at 12:30 PM, Niels Basjes <Ni...@basjes.nl>> wrote:

I respect immensely the contributions Doug has made to many Apache
projects,

Hear hear! I fully agree with that one.

On Tue, May 5, 2015 at 8:30 PM, Rich Haase <rh...@pandora.com>> wrote:

I respect immensely the contributions Doug has made to many Apache
projects, but I don’t think that should be a reason to force everyone to
write code as if our screen sizes can’t support more than 80 characters.

On May 5, 2015, at 12:21 PM, Niels Basjes <Ni...@basjes.nl><mailto:
Niels@basjes.nl<ma...@basjes.nl>>> wrote:

Perhaps we should tell him these screens can also be turned landscape ?
;)

But seriously:
1) Does Doug still actively work on code? From my perspective; Only very
infrequently.
2) In the 200+ people IT department where I work I know only 1 colleague
who uses his screen in portrait mode and he doesn't do code.

So, for who do we really stick to the 80 chars limit?

Niels

On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw...@altiscale.com>
<mailto:
aw@altiscale.com<ma...@altiscale.com>>> wrote:


On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com><mailto:
rhaase@pandora.com<ma...@pandora.com>>> wrote:

Can someone explain to me why on earth we care about limiting line
length to 80 characters?  Are there hadoop developers out there working
from teletype terminals?  Can we perhaps update this limit to something
sane, like 120 chars?






http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E





--
Best regards / Met vriendelijke groeten,

Niels Basjes

Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>






--
Best regards / Met vriendelijke groeten,

Niels Basjes


Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 | rhaase@pandora.com<ma...@pandora.com>





Re: Checkstyle 80 char limit

Posted by Arun Suresh <as...@cloudera.com>.
My 2 cents :
I actually like the lower char limit. Since most of the time, I end up
having to switch between classes, I end up splitting my screen vertically
and having multiple files open. for some reason, I find splitting
vertically is better for readability than horizontally.
In anycase, my IDE generally helps me format to 80 chars so, it has never
been a pain point for me.

On Tue, May 5, 2015 at 12:30 PM, Niels Basjes <Ni...@basjes.nl> wrote:

> > I respect immensely the contributions Doug has made to many Apache
> projects,
>
> Hear hear! I fully agree with that one.
>
> On Tue, May 5, 2015 at 8:30 PM, Rich Haase <rh...@pandora.com> wrote:
>
> > I respect immensely the contributions Doug has made to many Apache
> > projects, but I don’t think that should be a reason to force everyone to
> > write code as if our screen sizes can’t support more than 80 characters.
> >
> > On May 5, 2015, at 12:21 PM, Niels Basjes <Niels@basjes.nl<mailto:
> > Niels@basjes.nl>> wrote:
> >
> > Perhaps we should tell him these screens can also be turned landscape ?
> ;)
> >
> > But seriously:
> > 1) Does Doug still actively work on code? From my perspective; Only very
> > infrequently.
> > 2) In the 200+ people IT department where I work I know only 1 colleague
> > who uses his screen in portrait mode and he doesn't do code.
> >
> > So, for who do we really stick to the 80 chars limit?
> >
> > Niels
> >
> > On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw@altiscale.com
> <mailto:
> > aw@altiscale.com>> wrote:
> >
> >
> > On May 5, 2015, at 11:05 AM, Rich Haase <rhaase@pandora.com<mailto:
> > rhaase@pandora.com>> wrote:
> >
> > Can someone explain to me why on earth we care about limiting line
> > length to 80 characters?  Are there hadoop developers out there working
> > from teletype terminals?  Can we perhaps update this limit to something
> > sane, like 120 chars?
> >
> >
> >
> >
> >
> >
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
> >
> >
> >
> >
> >
> > --
> > Best regards / Met vriendelijke groeten,
> >
> > Niels Basjes
> >
> > Rich Haase| Sr. Software Engineer | Pandora
> > m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>
> >
> >
> >
> >
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>

Re: Checkstyle 80 char limit

Posted by Niels Basjes <Ni...@basjes.nl>.
> I respect immensely the contributions Doug has made to many Apache
projects,

Hear hear! I fully agree with that one.

On Tue, May 5, 2015 at 8:30 PM, Rich Haase <rh...@pandora.com> wrote:

> I respect immensely the contributions Doug has made to many Apache
> projects, but I don’t think that should be a reason to force everyone to
> write code as if our screen sizes can’t support more than 80 characters.
>
> On May 5, 2015, at 12:21 PM, Niels Basjes <Niels@basjes.nl<mailto:
> Niels@basjes.nl>> wrote:
>
> Perhaps we should tell him these screens can also be turned landscape ? ;)
>
> But seriously:
> 1) Does Doug still actively work on code? From my perspective; Only very
> infrequently.
> 2) In the 200+ people IT department where I work I know only 1 colleague
> who uses his screen in portrait mode and he doesn't do code.
>
> So, for who do we really stick to the 80 chars limit?
>
> Niels
>
> On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw@altiscale.com<mailto:
> aw@altiscale.com>> wrote:
>
>
> On May 5, 2015, at 11:05 AM, Rich Haase <rhaase@pandora.com<mailto:
> rhaase@pandora.com>> wrote:
>
> Can someone explain to me why on earth we care about limiting line
> length to 80 characters?  Are there hadoop developers out there working
> from teletype terminals?  Can we perhaps update this limit to something
> sane, like 120 chars?
>
>
>
>
>
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
>
>
>
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes
>
> Rich Haase| Sr. Software Engineer | Pandora
> m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>
>
>
>
>


-- 
Best regards / Met vriendelijke groeten,

Niels Basjes

Re: Checkstyle 80 char limit

Posted by Rich Haase <rh...@pandora.com>.
I respect immensely the contributions Doug has made to many Apache projects, but I don’t think that should be a reason to force everyone to write code as if our screen sizes can’t support more than 80 characters.

On May 5, 2015, at 12:21 PM, Niels Basjes <Ni...@basjes.nl>> wrote:

Perhaps we should tell him these screens can also be turned landscape ? ;)

But seriously:
1) Does Doug still actively work on code? From my perspective; Only very
infrequently.
2) In the 200+ people IT department where I work I know only 1 colleague
who uses his screen in portrait mode and he doesn't do code.

So, for who do we really stick to the 80 chars limit?

Niels

On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw...@altiscale.com>> wrote:


On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com>> wrote:

Can someone explain to me why on earth we care about limiting line
length to 80 characters?  Are there hadoop developers out there working
from teletype terminals?  Can we perhaps update this limit to something
sane, like 120 chars?




http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E





--
Best regards / Met vriendelijke groeten,

Niels Basjes

Rich Haase| Sr. Software Engineer | Pandora
m (303) 887-1146 |  rhaase@pandora.com<ma...@pandora.com>




Re: Checkstyle 80 char limit

Posted by Niels Basjes <Ni...@basjes.nl>.
Perhaps we should tell him these screens can also be turned landscape ? ;)

But seriously:
1) Does Doug still actively work on code? From my perspective; Only very
infrequently.
2) In the 200+ people IT department where I work I know only 1 colleague
who uses his screen in portrait mode and he doesn't do code.

So, for who do we really stick to the 80 chars limit?

Niels

On Tue, May 5, 2015 at 8:11 PM, Allen Wittenauer <aw...@altiscale.com> wrote:

>
> On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com> wrote:
>
> > Can someone explain to me why on earth we care about limiting line
> length to 80 characters?  Are there hadoop developers out there working
> from teletype terminals?  Can we perhaps update this limit to something
> sane, like 120 chars?
> >
>
>
>
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
>
>
>


-- 
Best regards / Met vriendelijke groeten,

Niels Basjes

Re: Checkstyle 80 char limit

Posted by "Colin P. McCabe" <cm...@apache.org>.
Historical issues aside, the reasons are:

* When doing vertical, side-by-side diffs, you need some reasonable
length length standard or else it Just Doesn't Work.  And vertical,
side-by-side diffs are how most people prefer to do code reviews.

* Really long lines are visually difficult to follow.  The academic
research is somewhat inconclusive on this topic, but the example of
newspapers, books, magazines, etc. suggests that in practice people do
not want lines that are as wide as possible.  They want and are used
to lines of reasonable length.  There is a reason why newspapers have
multiple columns, and it's not because our printing presses can't do a
single giant column.

* Really long lines encourage excessive nesting (the "Arrow
antipattern" described here: http://c2.com/cgi/wiki?ArrowAntiPattern
).  The more nesting, the more context you need to understand what's
going on.

Colin

On Tue, May 5, 2015 at 1:33 PM, Jake Low <ja...@isilon.com> wrote:
> Quoting Niels Basjes (2015-05-05 11:29:03)
>> So the 80 chars thing was at best reconsidered 16 years ago.
>>
>> Things have changed ...
>
> Limiting text to a particular width isn't just a byzantine coding convention.
> It arose in programming from much older practices, and it has persisted through
> the years because it improves readability (not just of code, but of any text).
>
> 80 columns was a fairly standard width for teletypes (and later of video
> terminals). This was mostly a cultural legacy of the IBM punch cards, which
> were 7.375" wide and contained 80 character columns.
>
> IBM introduced these cards in 1928, but they were not the first of their kind.
> Punched cards have been widely used since the early 19th century to control
> textile looms, mechanical church organs, and various other machines.
>
> I would posit that the choice of width for punched cards was chosen to match
> the width of printed text. Line length was historically tightly limited;
> sometimes pages would be divided into multiple narrow vertical columns. The
> original edition of the Gutenberg Bible is has a printed text area of about
> 11.7" tall by 8" wide and is divided into two vertical columns, each with about
> 34 characters per line.
>
> Newspapers and textbooks tend still to adhere to this practice -- they are
> usually printed in very narrow text columns (30 to 50 characters). Other books
> (particularly fiction) tend to be wider, at 60 to 70 characters per line, and
> some websites tend even wider than that.
>
> I don't believe that there's a particular line length that is optimal for all
> use cases, but I think there are two strong arguments for setting some (fairly
> conservative) line length limit when laying out conventions for code style.
>
> One is that people will find text most comfortable to read when it is formatted
> in a familiar way. Code is almost universally limited to a maximum of some
> number of characters per line (I've seen 80 most frequently, but also 72, 100,
> and 120).
>
> Another, which applies specifically to code, is that (unlike most prose) code
> is written in the same format in which it is archived and later read. So,
> unlike the debate about line length for web pages or printed books, the debate
> over code width applies not only to readability but also to *writability*.
>
> A professor of mine once told me that if I am writing code and reach the end of
> the (80-column) text area, I should pause to ask myself what has gone wrong.
> Perhaps my variable names are too verbose, or perhaps that line contains too
> much logic and should be separated into two lines. I still adhere to this, and
> I find that it consistently improves the quality of the code that I write.
>
> Perhaps 80 columns isn't the right number (certainly it would vary depending on
> the syntax of the language, conventions related to tab width, and other similar
> factors), but I do find that having such a limit forces me to pause and ask
> myself whether I can be clearer in my expression of the program's logic. I
> think this is a good thing.
>
> I don't wish to dismiss the option of revisiting the 80-columns convention. I
> only hope to have convinced you that code width is not just a legacy terminal
> compatibily issue -- it has important code quality and readability implications
> too, and those should be carefully considered when creating or updating a style
> guide.
>
> Best regards,
> -Jake

Re: Checkstyle 80 char limit

Posted by Jake Low <ja...@isilon.com>.
Quoting Niels Basjes (2015-05-05 11:29:03)
> So the 80 chars thing was at best reconsidered 16 years ago.
>
> Things have changed ...

Limiting text to a particular width isn't just a byzantine coding convention.
It arose in programming from much older practices, and it has persisted through
the years because it improves readability (not just of code, but of any text).

80 columns was a fairly standard width for teletypes (and later of video
terminals). This was mostly a cultural legacy of the IBM punch cards, which
were 7.375" wide and contained 80 character columns.

IBM introduced these cards in 1928, but they were not the first of their kind.
Punched cards have been widely used since the early 19th century to control
textile looms, mechanical church organs, and various other machines.

I would posit that the choice of width for punched cards was chosen to match
the width of printed text. Line length was historically tightly limited;
sometimes pages would be divided into multiple narrow vertical columns. The
original edition of the Gutenberg Bible is has a printed text area of about
11.7" tall by 8" wide and is divided into two vertical columns, each with about
34 characters per line.

Newspapers and textbooks tend still to adhere to this practice -- they are
usually printed in very narrow text columns (30 to 50 characters). Other books
(particularly fiction) tend to be wider, at 60 to 70 characters per line, and
some websites tend even wider than that.

I don't believe that there's a particular line length that is optimal for all
use cases, but I think there are two strong arguments for setting some (fairly
conservative) line length limit when laying out conventions for code style.

One is that people will find text most comfortable to read when it is formatted
in a familiar way. Code is almost universally limited to a maximum of some
number of characters per line (I've seen 80 most frequently, but also 72, 100,
and 120).

Another, which applies specifically to code, is that (unlike most prose) code
is written in the same format in which it is archived and later read. So,
unlike the debate about line length for web pages or printed books, the debate
over code width applies not only to readability but also to *writability*.

A professor of mine once told me that if I am writing code and reach the end of
the (80-column) text area, I should pause to ask myself what has gone wrong.
Perhaps my variable names are too verbose, or perhaps that line contains too
much logic and should be separated into two lines. I still adhere to this, and
I find that it consistently improves the quality of the code that I write.

Perhaps 80 columns isn't the right number (certainly it would vary depending on
the syntax of the language, conventions related to tab width, and other similar
factors), but I do find that having such a limit forces me to pause and ask
myself whether I can be clearer in my expression of the program's logic. I
think this is a good thing.

I don't wish to dismiss the option of revisiting the 80-columns convention. I
only hope to have convinced you that code width is not just a legacy terminal
compatibily issue -- it has important code quality and readability implications
too, and those should be carefully considered when creating or updating a style
guide.

Best regards,
-Jake

Re: Checkstyle 80 char limit

Posted by Niels Basjes <Ni...@basjes.nl>.
Quote from that page (i.e. the big block in RED at the top):

The information on this page is for Archive Purposes Only
This page is not being actively maintained.
Links within the documentation may not work and the information itself may
no longer be valid.
The last revision to this document was made on April 20, 1999


So the 80 chars thing was at best reconsidered 16 years ago.

Things have changed ...

Niels Basjes


On Tue, May 5, 2015 at 8:21 PM, Jonathan Eagles <je...@gmail.com> wrote:

> More formally, we follow the sun java coding standards which follow
> the 80 character limit. There is recent discussion over this, so it is
> a very relevant comment.
>
> http://wiki.apache.org/hadoop/HowToContribute
>
> http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html#313
>
> On Tue, May 5, 2015 at 1:11 PM, Allen Wittenauer <aw...@altiscale.com> wrote:
> >
> > On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com> wrote:
> >
> >> Can someone explain to me why on earth we care about limiting line
> length to 80 characters?  Are there hadoop developers out there working
> from teletype terminals?  Can we perhaps update this limit to something
> sane, like 120 chars?
> >>
> >
> >
> >
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
> >
> >
>



-- 
Best regards / Met vriendelijke groeten,

Niels Basjes

Re: Checkstyle 80 char limit

Posted by Jonathan Eagles <je...@gmail.com>.
More formally, we follow the sun java coding standards which follow
the 80 character limit. There is recent discussion over this, so it is
a very relevant comment.

http://wiki.apache.org/hadoop/HowToContribute
http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html#313

On Tue, May 5, 2015 at 1:11 PM, Allen Wittenauer <aw...@altiscale.com> wrote:
>
> On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com> wrote:
>
>> Can someone explain to me why on earth we care about limiting line length to 80 characters?  Are there hadoop developers out there working from teletype terminals?  Can we perhaps update this limit to something sane, like 120 chars?
>>
>
>
> http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E
>
>

Re: Checkstyle 80 char limit

Posted by Allen Wittenauer <aw...@altiscale.com>.
On May 5, 2015, at 11:05 AM, Rich Haase <rh...@pandora.com> wrote:

> Can someone explain to me why on earth we care about limiting line length to 80 characters?  Are there hadoop developers out there working from teletype terminals?  Can we perhaps update this limit to something sane, like 120 chars?
> 


http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/201407.mbox/%3CCALEq1Z8QvHof1A3zO0W5WGfbNjCOpfNo==JktQ8JiU6eFM_1RQ@mail.gmail.com%3E