In defence of 80-char lines

Jason Swails jason.swails at gmail.com
Thu Apr 4 08:13:30 EDT 2013


On Wed, Apr 3, 2013 at 9:36 PM, Steven D'Aprano <
steve+comp.lang.python at pearwood.info> wrote:

> Although PEP 8 is only compulsory for the Python standard library, many
> users like to stick to PEP 8 for external projects.
>

But even the standard library breaks this rule on occasion.  e.g.,
/usr/lib/python2.7/urllib.py:1095 (I remember seeing others, but this is
the first example I was able to find quickly).


>
> http://www.python.org/dev/peps/pep-0008/
>
> With perhaps one glaring exception: many people hate, or ignore, PEP 8's
> recommendation to limit lines to 80 characters. (Strictly speaking, 79
> characters.)
>
>
> Here is a good defence of 80 char lines:
>
> http://wrongsideofmemphis.com/2013/03/25/80-chars-per-line-is-great/


Personally, I try my best to keep all lines at 80 character max (80 +
newline, not 79).  In addition to liking my 84-character-width gvim windows
(to allow a little leeway) side-by-side for code references, I'm definitely
not above printing out some code to lay it out on a desk---that's not
something you can do on-screen without a wall of monitors in front of you.

The only time I regularly break my rule is for regular expressions (at some
point I may embrace re.X to allow me to break those up, too).

All the best,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130404/c800ffc6/attachment.html>


More information about the Python-list mailing list