About the 79 character line recommendation

Virgil Dupras hardcoded.software at gmail.com
Tue Dec 5 15:00:10 EST 2006


Steve Bergman wrote:
> As I study Python, I am trying to develop good, Pythonic, habits.  For
> one thing, I am trying to keep Guido's the style guide in mind.
>
> And I know that it starts out saying that it should not be applied in
> an absolute fashion.
>
> However, I am finding that the 79 character line prescription is not
> optimal for readability.
>
> Certainly, cutting back from the length of lines that I used to use has
> *helped* readability.  But if I triy very hard to apply 79, I think
> readability suffers.  If this were just something that was an issue
> occasionally, I would just put it off to "know when to break the
> rules".  However, find myself going to 90 to 100 characters very
> frequently.  Now, if it were just me, I'd shoot for < 100.  However,
> the Python philosophy includes making code easier for others to read,
> as well.
>
> So, I was wondering what more accomplished Python programmers thought
> about this.
>
> While I'm on this general topic, the guide mentions a pet peeve about
> inserting more than one space to line up the "=" in assignment
> statements.  To me, lining them up, even if it requires quite a few
> extra spaces, helps readability quite a bit.  Comments?
>
> Thanks,
> Steve Bergman

I also think that limiting code to 80 columns often hinders
readability. I personally try to limit my code to 100 columns. The end
result is pretty nice.

However, I'm all for the "flat is better than nested" philosophy, even
when nested is under 100 columns.




More information about the Python-list mailing list