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


Groups > comp.lang.python > #31593 > unrolled thread

A desperate lunge for on-topic-ness

Started byZero Piraeus <schesis@gmail.com>
First post2012-10-18 02:06 -0400
Last post2012-10-19 15:16 -0700
Articles 7 on this page of 27 — 15 participants

Back to article view | Back to comp.lang.python


Contents

  A desperate lunge for on-topic-ness Zero Piraeus <schesis@gmail.com> - 2012-10-18 02:06 -0400
    Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-18 06:31 +0000
      Re: A desperate lunge for on-topic-ness Hans Mulder <hansmu@xs4all.nl> - 2012-10-18 11:07 +0200
        Re: A desperate lunge for on-topic-ness wxjmfauth@gmail.com - 2012-10-18 02:33 -0700
          Re: A desperate lunge for on-topic-ness Tim Chase <python.list@tim.thechases.com> - 2012-10-18 06:05 -0500
        Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-18 21:01 +1100
        RE: A desperate lunge for on-topic-ness "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-18 18:42 +0000
        Re: A desperate lunge for on-topic-ness Ben Finney <ben+python@benfinney.id.au> - 2012-10-19 11:33 +1100
          Re: A desperate lunge for on-topic-ness rusi <rustompmody@gmail.com> - 2012-10-18 20:35 -0700
            Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 04:08 +0000
      Re: A desperate lunge for on-topic-ness Zero Piraeus <schesis@gmail.com> - 2012-10-18 06:31 -0400
    Re: A desperate lunge for on-topic-ness rusi <rustompmody@gmail.com> - 2012-10-17 23:55 -0700
    Re: A desperate lunge for on-topic-ness Paul Rubin <no.email@nospam.invalid> - 2012-10-17 23:56 -0700
    Re: A desperate lunge for on-topic-ness Grant Edwards <invalid@invalid.invalid> - 2012-10-18 13:16 +0000
      Re: A desperate lunge for on-topic-ness Ben Finney <ben+python@benfinney.id.au> - 2012-10-19 11:39 +1100
    Re: A desperate lunge for on-topic-ness Den <patentsvnc@gmail.com> - 2012-10-18 08:55 -0700
      Re: A desperate lunge for on-topic-ness Neil Cerutti <neilc@norwich.edu> - 2012-10-18 16:13 +0000
        Re: A desperate lunge for on-topic-ness Chris Angelico <rosuav@gmail.com> - 2012-10-19 03:21 +1100
        RE: A desperate lunge for on-topic-ness "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-18 18:51 +0000
      RE: A desperate lunge for on-topic-ness "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-18 18:50 +0000
      Re: A desperate lunge for on-topic-ness Zero Piraeus <schesis@gmail.com> - 2012-10-18 17:36 -0400
        Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 01:50 +0000
    Re: A desperate lunge for on-topic-ness Den <patentsvnc@gmail.com> - 2012-10-18 08:55 -0700
      Re: A desperate lunge for on-topic-ness Grant Edwards <invalid@invalid.invalid> - 2012-10-18 17:44 +0000
        Re: A desperate lunge for on-topic-ness Gene Heskett <gheskett@wdtv.com> - 2012-10-18 18:53 -0400
    Re: A desperate lunge for on-topic-ness Krzysztof Voss <shobbo@gmail.com> - 2012-10-19 15:16 -0700
    Re: A desperate lunge for on-topic-ness Krzysztof Voss <shobbo@gmail.com> - 2012-10-19 15:16 -0700

Page 2 of 2 — ← Prev page 1 [2]


#31686

FromZero Piraeus <schesis@gmail.com>
Date2012-10-18 17:36 -0400
Message-ID<mailman.2476.1350596242.27098.python-list@python.org>
In reply to#31654
:

On 18 October 2012 11:55, Den <patentsvnc@gmail.com> wrote:
> [...] I'm amused by the whole question, and others related
> to PEP8.  A quick aside, the width of our roads all go back to the
> width of a two horse rig.  The suggested maximum of 80 characters goes
> back to teletype machines, and IBM cards, and character based
> terminals [...]

... and the decisions made back in the day about line length on
teletypes etc. were informed [perhaps unconsciously] by the rules of
printed literature - and *those* rules have a *lot* of accumulated
wisdom behind them.

Robert Bringhurst's Elements of Typographical Style is very good on
that stuff; one thing he points out is that, at root, what's
comfortable is defined by the size of the human hand, the distance we
hold a book from our eye, etc. ... and while we still live in a world
composed of physical objects, a lot of that gut feeling about what's
comfortable carries across into the digital world.

The accepted rule in print is that lines of prose should be between 45
and 90 characters, with 66 being ideal for readability. Code is not
prose, and the combination of fixed-width and much more variable line
length aids readability, but however it came about, ~80 does seem to
more or less work as a limit.

I'm pretty slavish about adhering to PEP 8 these days. Programmers are
an opinionated bunch, and we all, given the opportunity, will come up
with our own set of obviously [goddammit] correct rules. Having a
broadly sensible, authoritative set of guidelines that we grudgingly
agree to follow makes working with other coders easier IMO.

 -[]z.

[toc] | [prev] | [next] | [standalone]


#31705

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2012-10-19 01:50 +0000
Message-ID<5080b1d7$0$29985$c3e8da3$5496439d@news.astraweb.com>
In reply to#31686
On Thu, 18 Oct 2012 17:36:57 -0400, Zero Piraeus wrote:

> The accepted rule in print is that lines of prose should be between 45
> and 90 characters, with 66 being ideal for readability. Code is not
> prose, and the combination of fixed-width and much more variable line
> length aids readability, but however it came about, ~80 does seem to
> more or less work as a limit.

On the other hand, code is typically *much* harder to understand than 
normal prose.

On the third hand, the "chunks" of semantic meaning in code is 
significantly greater -- you can often ignore 99% of the code and just 
skim past it, and so not even notice long line lengths until you get to 
the specific few lines you care about. But once you reach the lines you 
care about, or *might* care about, horizontal space is costly and 
vertical space is cheap.

So reading code often has two distinct phases: skim and inspect. When 
skimming, vertical space is at a premium, and you want to fit as much 
code as possible in as few lines as possible. When inspecting code 
closely, you want to fit as little code as practical in each line. So 
there's a trade-off.

But for anything but the most horribly obfuscated code, it is much easier 
to identify bits of code that are irrelevant to your problem than to 
identify which bit of code is specifically causing the bug. So skimming 
is inherently easier than close study (well duh). Consequently it is wise 
to optimise your code layout for the hard parts, not the easy parts, and 
so you should treat vertical space is cheaper than horizontal space, and 
try to keep your line length down.

And note that, even when writing, most of your time is problem spent in 
writing what is already there. Coding is rarely like typing out dictation.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#31655

FromDen <patentsvnc@gmail.com>
Date2012-10-18 08:55 -0700
Message-ID<mailman.2449.1350575755.27098.python-list@python.org>
In reply to#31593
On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote:
> :
> 
> 
> What are people's preferred strategies for dealing with lines that go
> 
> over 79 characters? A few I can think of off the bat:
> 

I personally just keep typing until my statement is finished.  This is my program, not PEP's.

But I have to say I'm amused by the whole question, and others related to PEP8.  A quick aside, the width of our roads all go back to the width of a two horse rig.  The suggested maximum of 80 characters goes back to teletype machines, and IBM cards, and character based terminals

Should that really be the basis for a suggested style now?

Den

[toc] | [prev] | [next] | [standalone]


#31668

FromGrant Edwards <invalid@invalid.invalid>
Date2012-10-18 17:44 +0000
Message-ID<k5pf6a$185$1@reader1.panix.com>
In reply to#31655
On 2012-10-18, Den <patentsvnc@gmail.com> wrote:
> On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote:
>
>> What are people's preferred strategies for dealing with lines that go
>> 
>> over 79 characters? A few I can think of off the bat:
>
> I personally just keep typing until my statement is finished.  This
> is my program, not PEP's.
>
> But I have to say I'm amused by the whole question, and others
> related to PEP8.  A quick aside, the width of our roads all go back
> to the width of a two horse rig.  The suggested maximum of 80
> characters goes back to teletype machines, and IBM cards, and
> character based terminals
>
> Should that really be the basis for a suggested style now?

You don't expect me to through my Heathkit H19 terminal in the trash,
do you?  :)

-- 
Grant Edwards               grant.b.edwards        Yow! This is a NO-FRILLS
                                  at               flight -- hold th' CANADIAN
                              gmail.com            BACON!!

[toc] | [prev] | [next] | [standalone]


#31693

FromGene Heskett <gheskett@wdtv.com>
Date2012-10-18 18:53 -0400
Message-ID<mailman.2482.1350601231.27098.python-list@python.org>
In reply to#31668
On Thursday 18 October 2012 18:40:52 Grant Edwards did opine:

> On 2012-10-18, Den <patentsvnc@gmail.com> wrote:
> > On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote:
> >> What are people's preferred strategies for dealing with lines that go
> > 
> >> over 79 characters? A few I can think of off the bat:
> > I personally just keep typing until my statement is finished.  This
> > is my program, not PEP's.
> > 
> > But I have to say I'm amused by the whole question, and others
> > related to PEP8.  A quick aside, the width of our roads all go back
> > to the width of a two horse rig.  The suggested maximum of 80
> > characters goes back to teletype machines, and IBM cards, and
> > character based terminals
> > 
> > Should that really be the basis for a suggested style now?
> 
> You don't expect me to through my Heathkit H19 terminal in the trash,
> do you?  :)

Or me to delete the vt-220 I wrote to run on a TRS-80 Color Computer 
running OS-9 for an OS, 20 years ago when the Dec made one ate its H.O.T. & 
Dec would not sell me a H.O.T. since it was over 5 years old and wanted 
$2995 for brand new vt-550 (with no guarantee it would be compatible)?

That, and their field service engineers inability to fix a crashing hourly 
or more PDP-11/723a amply explains why DEC is no longer with us.

That single obstinate computer made the CBS tv network design a new system 
and distribute it gratis to every network affiliate they had, somewhere 
around 125 stations, at a cost of at least 10G's a station.

Screw that.  I had better things to than throw more good money after bad.
So did CBS at the time.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
How sharper than a hound's tooth it is to have a thankless serpent.

[toc] | [prev] | [next] | [standalone]


#31778

FromKrzysztof Voss <shobbo@gmail.com>
Date2012-10-19 15:16 -0700
Message-ID<1253911f-9e32-41b4-8de8-fbe005271208@googlegroups.com>
In reply to#31593
On Thursday, October 18, 2012 12:06:43 AM UTC-6, Zero Piraeus wrote:
> :
> 
> 
> 
> Okay, so, first thing vaguely Python-related that comes to mind [so
> 
> probably not even slightly original, but then that's not really the
> 
> point]:
> 
> 
> 
> What are people's preferred strategies for dealing with lines that go
> 
> over 79 characters? A few I can think of off the bat:
> 
> 
> 
> 1. Say "screw it" and go past 79, PEP8 be damned.
> 
Once you ":set cc=79", you never want to cross it.

> 
> 
> 2. Say "screw it" and break the line using a backslash.
> 
> 
> 
> 3. Say "well, at least it's not a backslash" and break the line using
> 
> parentheses.
> 
> 
Some nice, IMHO, tips on the style can be found in:
http://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Line_length


Cheers!

[toc] | [prev] | [next] | [standalone]


#31779

FromKrzysztof Voss <shobbo@gmail.com>
Date2012-10-19 15:16 -0700
Message-ID<mailman.2539.1350685022.27098.python-list@python.org>
In reply to#31593
On Thursday, October 18, 2012 12:06:43 AM UTC-6, Zero Piraeus wrote:
> :
> 
> 
> 
> Okay, so, first thing vaguely Python-related that comes to mind [so
> 
> probably not even slightly original, but then that's not really the
> 
> point]:
> 
> 
> 
> What are people's preferred strategies for dealing with lines that go
> 
> over 79 characters? A few I can think of off the bat:
> 
> 
> 
> 1. Say "screw it" and go past 79, PEP8 be damned.
> 
Once you ":set cc=79", you never want to cross it.

> 
> 
> 2. Say "screw it" and break the line using a backslash.
> 
> 
> 
> 3. Say "well, at least it's not a backslash" and break the line using
> 
> parentheses.
> 
> 
Some nice, IMHO, tips on the style can be found in:
http://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Line_length


Cheers!

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web