Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51566

Re: PEP8 79 char max

From Neil Cerutti <neilc@norwich.edu>
Newsgroups comp.lang.python
Subject Re: PEP8 79 char max
Date 2013-07-30 14:49 +0000
Organization Norwich University
Message-ID <b5q232F3icnU1@mid.individual.net> (permalink)
References <51F6C5F5.5020201@Gmail.com> <kt6l70$6q4$1@ger.gmane.org> <CANc-5UwuE2w7d9NHaaWDwYeLtE6aSQrGXoTMx4k9xYxa6T6UfA@mail.gmail.com> <CAN1F8qWpgKRmF8bUq5_=uiMGnjmEHnWu_r+rjVcmmrOddDLCoQ@mail.gmail.com> <mailman.5309.1375193222.3114.python-list@python.org>

Show all headers | View raw


On 2013-07-30, Skip Montanaro <skip@pobox.com> wrote:
>> In that gauge I would exclude indentation (you don't count the
>> number of characters the margin takes) ....
>
> I don't think anyone reads the margins. :-)
>
> That said, I agree that code and prose are fundamentally
> different beasts.  Still, when reading either and you get to
> the end of the line, you need to shift your gaze down a line
> and back to the left margin (or the left margin plus any
> indentation).  That task becomes more difficult as line length
> increases.

Most research about speed of comprehension of different line
lengths was based on subjects reading prose. The effect of code
line length hasn't been studied extensively.

> As programmers/software engineers, we need to read and write
> both code and text. I think 80 columns is still a decent
> compromise.

So rules of thumb, standardizations, and personal preferences are
mostly what we have to go by.

When code that looks very similar to code you've seen before
really *is* similar to code you've seen before, comprehension
speed can increase. A study of chess masters' ability to memorize
chess positions showed that they were powerfully accurate when
shown positions from real games, but no better than the average
schmoe when shown randomly positioned pieces. So if everyone
basically follows PEP8 we all benefit from playing by the same
game rules, as it were.

-- 
Neil Cerutti

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: PEP8 79 char max Skip Montanaro <skip@pobox.com> - 2013-07-30 09:06 -0500
  Re: PEP8 79 char max Neil Cerutti <neilc@norwich.edu> - 2013-07-30 14:49 +0000
    Re: PEP8 79 char max Skip Montanaro <skip@pobox.com> - 2013-07-30 10:44 -0500
    Re: PEP8 79 char max Joshua Landau <joshua@landau.ws> - 2013-07-30 17:41 +0100

csiph-web