[Tutor] Pep 8, about indentation
alan.gauld at btinternet.com
Thu Aug 6 12:03:38 CEST 2015
On 06/08/15 04:40, Steven D'Aprano wrote:
> Um, the oldest standard for TABs is *eight* spaces, not 3 or 4,
Yes, but that comes from the days of mechanical typewriters not any
study of code comprehension. I was referring to the recommended spacing
for comprehending code. There were a lot of studies done on this back in
the 70's and 80's. The only one I can find a reference to right now is
an Article from 1983, "Program Indentation and Comprehensibility" by
Miaria et al. It showed a 20-30% improved comprehension based
on 2-4 tabs. 0-1 space tabs and larger tabs decreased the
comprehensibility of the code.
> For interest, here's a survey done by Perl programmers in 2002:
Yes, but that's a survey of what developers prefer to use. It's not a
study of whose code is most reliably read and understood!
(Which in the case of Perl might not be very high for any style!!)
Developers are notoriously bad at choosing the most readable
standard, they tend to go by what they think looks pretty.
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
More information about the Tutor