Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'parameters': 0.04; 'argument': 0.05; 'insert': 0.05; 'skip:\xa0 30': 0.05; 'arguments': 0.09; 'cc:addr:python-list': 0.11; '>>': 0.16; 'cleaner': 0.16; 'prefered': 0.16; 'rarely': 0.16; 'readable': 0.16; 'tempted': 0.16; 'to:addr:python.list': 0.16; 'to:addr:tim.thechases.com': 0.16; 'to:name:tim chase': 0.16; 'unpacking': 0.16; 'wrote:': 0.18; 'skip:f 30': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'apply.': 0.24; 'typical': 0.24; '(or': 0.24; "i've": 0.25; '>': 0.26; 'class.': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'properties': 0.29; 'tim': 0.29; '8bit%:3': 0.30; 'css': 0.30; 'ease': 0.30; 'message-id:@mail.gmail.com': 0.30; 'chase': 0.31; "we're": 0.32; "i'd": 0.34; 'skip:s 30': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'keyword': 0.36; 'should': 0.36; 'skip:& 20': 0.39; '8bit%:6': 0.40; 'how': 0.40; 'most': 0.60; 'tracking': 0.61; 'more': 0.64; 'here': 0.66; 'reads': 0.68; ':).': 0.84; 'otten': 0.84; 'imagine': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=okM3k6F5vTHh1A2VZ1NXk+mR5k0qOuoA+LOwbkBh7XY=; b=eX9s2H/1s6nHT2R6qflklZl2Cq5y50z1PUMREAu3+EC8tBVv2CAFIwWYDGXaZ06B+b 5UvYdA2CSYMbuKbWJH7/CyHzcbBkY53w+p5TIqTrvn9PIIC3yYOf2Ws+UDlhf/MxMzmA hJeTUUsiFMIn801AEZue9QZkotI+mtCP+VbN+wQeLclMr8YsXv9qO/JX3PeIi/Q40Wvy JXPwN3rKFje2G9k4ttL3aT4blmb/WB0U4y7mhzxJSOYcKPTgYt+meJOjKy6zF4S6N5pt s8Maj21V7W3R5oq5Mf965WUKm5Z3SkU/5AL5Hn/9vL/TX+mBidwCw+lkEcogK7DNL4kW Sugg== X-Received: by 10.112.20.133 with SMTP id n5mr3932415lbe.113.1365095920217; Thu, 04 Apr 2013 10:18:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20130404060913.2e771293@bigbox.christie.dr> References: <515cd919$0$29966$c3e8da3$5496439d@news.astraweb.com> <20130404060913.2e771293@bigbox.christie.dr> From: Joshua Landau Date: Thu, 4 Apr 2013 18:18:00 +0100 Subject: Re: In defence of 80-char lines To: Tim Chase Content-Type: multipart/alternative; boundary=14dae94732d368b96b04d98c29dd Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 159 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365095929 news.xs4all.nl 6985 [2001:888:2000:d::a6]:41126 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42766 --14dae94732d368b96b04d98c29dd Content-Type: text/plain; charset=ISO-8859-1 On 4 April 2013 12:09, Tim Chase wrote: > On 2013-04-04 08:43, Peter Otten wrote: > > llanitedave wrote: > >> self.mainLabel.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD, > faceName = "FreeSans")) > > > > I think I would prefer > > > > labelfont = wx.Font( > > pointSize=12, > > style=wx.DEFAULT, > > family=wx.NORMAL, > > weight=wx.BOLD, > > faceName="FreeSans") > > self.mainLabel.SetFont(labelfont) > > +1 > The only change I'd make to this suggestion would be to add a > semi-superfluous comma+newline after the last keyword argument too: > > labelfont = wx.Font( > pointSize=12, > style=wx.DEFAULT, > family=wx.NORMAL, > weight=wx.BOLD, > faceName="FreeSans", > ) > Since we're all showing opinions, I've always prefered the typical block indentation: labelfont = wx.Font( pointSize=12, style=wx.DEFAULT, family=wx.NORMAL, weight=wx.BOLD, faceName="FreeSans", ) # Not indented here as A( B( C, D, E, ) ) reads a lot cleaner than A( B( C, D, E ) ) which makes diffs cleaner when you need to insert something after > faceName: > That is a very good point :). Additionally, if there are lots of keyword parameters like this, I'd > be tempted to keep them in sorted order for ease of tracking them > down (though CSS has long-standing arguments on how properties should > be ordered, so to each their own on this). > Personally I'd rarely be tempted to put more than 9 or so arguments directly into a function or class. Most of the time I can imagine unpacking (or equiv.) would look much more readable in the circumstances that apply. --14dae94732d368b96b04d98c29dd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 4 April 2013 12:09, Tim Chase <python.list= @tim.thechases.com> wrote:
On 2013-04-04 08:43, Peter Otten wrote:
> llanitedave wrote:
>> self.mainLabel.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD,= faceName =3D "FreeSans"))
>
> I think I would prefer
>
> labelfont =3D wx.Font(
> =A0 =A0 pointSize=3D12,
> =A0 =A0 style=3Dwx.DEFAULT,
> =A0 =A0 family=3Dwx.NORMAL,
> =A0 =A0 weight=3Dwx.BOLD,
> =A0 =A0 faceName=3D"FreeSans")
> self.mainLabel.SetFont(labelfont)

+1
The only change I'd make to this suggestion would be to add a
semi-superfluous comma+newline after the last keyword argument too:

=A0labelfont =3D wx.Font(
=A0 =A0 =A0pointSize=3D12,
=A0 =A0 =A0style=3Dwx.DEFAULT,
=A0 =A0 =A0family=3Dwx.NORMAL,
=A0 =A0 =A0weight=3Dwx.BOLD,
=A0 =A0 =A0faceName=3D"FreeSans",
=A0 =A0 =A0)

Since we're all showin= g opinions, I've always prefered the typical block indentation:

labelfont =3D wx.Font(
=A0 =A0 pointSize=3D12,
=A0 =A0 style=3Dwx.DEFAULT,
=A0 =A0 family=3D= wx.NORMAL,
=A0 =A0 weight=3Dwx.BOLD,
=A0 =A0 faceName=3D"F= reeSans",
) # Not indented here

as

A(
=A0 =A0 B(
=A0 =A0 =A0 =A0 C,
=A0 =A0 =A0 =A0 D,
=A0 =A0 =A0 =A0 E,
=A0 =A0 )
)

reads a lot cleaner than

A(
=A0 =A0 B(
=A0 =A0 =A0 =A0 = C,
=A0 =A0 =A0 =A0 D,
=A0 =A0 =A0 =A0 E
=A0 = =A0 =A0 =A0 )
=A0 =A0 )

which makes diffs cleaner when you need to insert something after
faceName:
<DIFS SNIP>

That is a very good point :).

Additionally, if there are lots of keyword parameters like this, I'd be tempted to keep them in sorted order for ease of tracking them
down (though CSS has long-standing arguments on how properties should
be ordered, so to each their own on this).

<= div>Personally I'd rarely be tempted to put more than 9 or so arguments= directly into a function or class. Most of the time I can imagine unpackin= g (or equiv.) would look much more readable in the circumstances that apply= .=A0 --14dae94732d368b96b04d98c29dd--