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


Groups > comp.lang.python > #42749

Re: In defence of 80-char lines

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jason.swails@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; '(at': 0.04; 'expressions': 0.07; 'e.g.,': 0.09; 'lines:': 0.09; 'pep': 0.09; 'references,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'windows': 0.15; 'cc:name:python list': 0.16; 'defence': 0.16; 'exception:': 0.16; 'monitors': 0.16; 'newline,': 0.16; 'personally,': 0.16; 'too).': 0.16; 'url:pep-0008': 0.16; 'url:peps': 0.16; 'you..': 0.16; 'wrote:': 0.18; 'library': 0.18; 'wed,': 0.18; 'example': 0.22; 'cc:addr:python.org': 0.22; 'char': 0.24; 'library,': 0.24; 'stick': 0.24; 'url:dev': 0.24; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'external': 0.29; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'lines': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'front': 0.32; 'regular': 0.32; 'url:python': 0.33; 'projects.': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'jason': 0.38; 'pm,': 0.38; 'little': 0.38; 'skip:8 10': 0.39; 'users': 0.40; 'even': 0.60; 'up,': 0.60; 'break': 0.61; 'first': 0.61; 'you.': 0.62; 'wall': 0.65; 'here': 0.66; 'limit': 0.70; 'embrace': 0.84; 'liking': 0.84; 'skip:/ 30': 0.84; 'url:03': 0.84; 'url:2013': 0.84; 'to:none': 0.92; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:cc:content-type; bh=FppzDCmO/ZOgDvVTRtI3eprrG3y6pD/2vHq4O5fgcdM=; b=viDsweAiRVTQvc2hr0DE/MPy8HY71idFIfnMIu/skl5CArgA9CAOKMAit3lorfR3vy GmUwQ6pTeMJc4O7FfMceyR05u36Lt8SsmJgbAKhdu52OMJMtALODwwAmYTB7jTodqsxc 1YzwUVjr2GF00Al2/iydnHqPHs8RzESkLQYVTV406Lt3HvtsG5PUMtqpHD3Dzu/PPUQI 7Q3RzdcjrCBl9wzWp4fxRIMFWU3qsKfYZjQT4F0rcG6o/Mz9dU3Sou0qm2m8qMehqgX1 bKDIWF6Pk/khcAz1Uu5pYb3uParQgOafwEAaRg5svKZ6W+P5HzXRCnTEct0EqU6/Uxek QMjg==
MIME-Version 1.0
X-Received by 10.42.70.74 with SMTP id e10mr3213656icj.38.1365077610175; Thu, 04 Apr 2013 05:13:30 -0700 (PDT)
In-Reply-To <515cd919$0$29966$c3e8da3$5496439d@news.astraweb.com>
References <515cd919$0$29966$c3e8da3$5496439d@news.astraweb.com>
Date Thu, 4 Apr 2013 08:13:30 -0400
Subject Re: In defence of 80-char lines
From Jason Swails <jason.swails@gmail.com>
Cc python list <python-list@python.org>
Content-Type multipart/alternative; boundary=90e6ba2121bb0ba43204d987e6b4
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.96.1365077619.3114.python-list@python.org> (permalink)
Lines 91
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365077619 news.xs4all.nl 6961 [2001:888:2000:d::a6]:46816
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42749

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, Apr 3, 2013 at 9:36 PM, Steven D'Aprano <
steve+comp.lang.python@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

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


Thread

In defence of 80-char lines Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-04 01:36 +0000
  Re: In defence of 80-char lines Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-03 20:59 -0500
  Re: In defence of 80-char lines Mitya Sirenef <msirenef@lightbird.net> - 2013-04-03 22:40 -0400
  Re: In defence of 80-char lines llanitedave <llanitedave@veawb.coop> - 2013-04-03 21:32 -0700
    Re: In defence of 80-char lines Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-04 06:33 +0000
    Re: In defence of 80-char lines gregor <gregor@ediwo.com> - 2013-04-04 08:40 +0200
    Re: In defence of 80-char lines Peter Otten <__peter__@web.de> - 2013-04-04 08:43 +0200
    Re: In defence of 80-char lines Tim Chase <python.list@tim.thechases.com> - 2013-04-04 06:09 -0500
    Re: In defence of 80-char lines Roy Smith <roy@panix.com> - 2013-04-04 07:52 -0400
      Re: In defence of 80-char lines llanitedave <llanitedave@veawb.coop> - 2013-04-04 08:28 -0700
    Re: In defence of 80-char lines Jason Swails <jason.swails@gmail.com> - 2013-04-04 08:18 -0400
    Re: In defence of 80-char lines Joshua Landau <joshua.landau.ws@gmail.com> - 2013-04-04 18:18 +0100
    Re: In defence of 80-char lines Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-04-04 18:22 -0400
  Re: In defence of 80-char lines rusi <rustompmody@gmail.com> - 2013-04-03 21:56 -0700
  Re: In defence of 80-char lines Rui Maciel <rui.maciel@gmail.com> - 2013-04-04 08:15 +0100
  Re: In defence of 80-char lines Jason Swails <jason.swails@gmail.com> - 2013-04-04 08:13 -0400
    Re: In defence of 80-char lines Roy Smith <roy@panix.com> - 2013-04-04 08:39 -0400
      Re: In defence of 80-char lines Jason Swails <jason.swails@gmail.com> - 2013-04-04 09:23 -0400
      Re: In defence of 80-char lines Neil Cerutti <neilc@norwich.edu> - 2013-04-04 15:56 +0000
      Re: In defence of 80-char lines Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2013-04-04 23:04 +0530
        Re: In defence of 80-char lines Roy Smith <roy@panix.com> - 2013-04-04 19:55 -0400
  Re: In defence of 80-char lines Mitya Sirenef <msirenef@lightbird.net> - 2013-04-04 12:12 -0400
  Re: In defence of 80-char lines jmfauth <wxjmfauth@gmail.com> - 2013-04-04 13:28 -0700
    Re: In defence of 80-char lines Jason Swails <jason.swails@gmail.com> - 2013-04-04 17:00 -0400
    Re: In defence of 80-char lines Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-05 00:14 +0000

csiph-web