In defence of 80-char lines

llanitedave llanitedave at veawb.coop
Thu Apr 4 11:28:13 EDT 2013


On Thursday, April 4, 2013 4:52:38 AM UTC-7, Roy Smith wrote:
> In article <c338b844-e9ce-46a7-9daf-20374372390e at googlegroups.com>,
> 
>  llanitedave <llanitedave at veawb.coop> wrote:
> 
>  
> 
> > I would hate to have to break up this line, for instance:
> 
> > 
> 
> > self.mainLabel.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD, faceName = 
> 
> > "FreeSans"))
> 
> 
> 
> I would write that as some variation on
> 
> 
> 
> self.mainLabel.SetFont(wx.Font(12,
> 
>                                wx.DEFAULT,
> 
>                                wx.NORMAL,
> 
>                                wx.BOLD, 
> 
>                                faceName="FreeSans"))
> 
> 
> 
> This lets the reader see at a glance that all the arguments go with 
> 
> wx.Font(), not with SetFont(), without having to visually parse and 
> 
> match parenthesis levels.
> 
> 
> 
> Actually, I would probably break it up further as:
> 
> 
> 
> my_font = wx.Font(12,
> 
>                   wx.DEFAULT,
> 
>                   wx.NORMAL,
> 
>                   wx.BOLD,
> 
>                   faceName="FreeSans")
> 
> self.mainLabel.SetFont(my_font)
> 
> 
> 
> The last thing on my mind when deciding how to format this is whether I 
> 
> would be able to punch it onto a single card.

To each their own, definitely.  For myself, I don't see the utility in adding a bunch of what appears to be superfluous horizontal white space at the expense of extra lines to scroll down.  I like to limit my scrolling needs in *both* directions.
(Although I do tend to be fairly generous with blank lines to break up code "paragraphs")




More information about the Python-list mailing list