[Python-ideas] PEP 8 update on line length

Juancarlo Añez apalala at gmail.com
Fri Feb 22 17:23:31 EST 2019


On Fri, Feb 22, 2019 at 5:10 PM Greg Ewing <greg.ewing at canterbury.ac.nz>
wrote:

> I would say it the other way around. Once you've reduced the complexity
> of a line to something a human can handle, *most* of the time 80 chars
> is enough.
>

+1

It has been known for a very long time.

These are *old *books that talk about *refactoring* (the word wasn't used
then) of complex code (assigning subexpressions to variables, or extracting
code into functions, reverting conditionals, etc.), not for line length,
but for understandability, yet resulting nevertheless in much shorter lines:

   - Software Tools (also Software Tools in Pascal), Kernighan and Plauger,
   1976
   https://smile.amazon.com/Software-Tools-Brian-W-Kernighan/dp/020103669X
   - Code Complete (also the second edition), Steve Mc Connell, 1993,
   https://smile.amazon.com/Software-Tools-Brian-W-Kernighan/dp/020103669X

I do make an exception in that after taking 8 spaces of indentation to
write the implementation of a method in Python, the sweet spot is more
around 100 chars.

-- 
Juancarlo *Añez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190222/3effc5aa/attachment.html>


More information about the Python-ideas mailing list