[Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS
Steven D'Aprano
steve at pearwood.info
Thu Jan 31 02:05:58 EST 2019
On Wed, Jan 30, 2019 at 05:41:56PM -0600, Abe Dillon wrote:
> I don't know how to make myself more clear. I haven't been talking about
> entire documents. Some of the links I provided discuss tests conducted on
> entire documents. That is not relevant to this discussion.
Then why on earth are you providing those links as support for your
assertion that the use of a few all-caps identifiers anywhere on the
page "destroys the visual flow of code" (your words) and reduces
readability?
Don't blame us for the fact that the links you provided don't actually
support your assertions. You chose them, you posted them at least three
times, if they don't support your position it is cheeky of you to tell
us now that they are irrelevant.
The links you have provided definitively support the idea that large
paragraphs of all-caps text hurt readability, reducing reading speed by
about 10%. But they say nothing about the cost of using the odd all-caps
word here or there.
Ten percent decrease in reading speed is nothing to sneer at, but it is
a relatively minor cost.
In any case, those readability tests were performed on ordinary
non-programmers, reading prose text. For programmers reading code, I
would expect that the physical cost of reading words is likely to be
only a very small proportion of the total cost of comprehending the
code.
I've spent *hours* trying to understand the semantics of code that took
seconds to read. Compared to that, what's plus or minus ten percent?
But never mind, let's go with the 10% figure. That applies to an entire
paragraph of all-caps, versus mixed case. It says nothing about the cost
of using one or two, or even ten or twelve, all-caps identifiers in
pages of code which is otherwise 95% or more mixed case.
If 100% all-caps is 10% more costly to read, then 5% all-caps is
probably no more than 0.5% more costly to read. Which puts it firmly in
"margin of error" territory.
--
Steven
More information about the Python-ideas
mailing list