[Python-Dev] pep8 reasoning
Allen Li
cyberdupo56 at gmail.com
Fri Apr 25 03:40:01 CEST 2014
On Thu, Apr 24, 2014 at 11:36:03AM -0500, Tim Peters wrote:
> There's been a bit of serious study on this. The results are still
> open to interpretation, though ;-) Here's a nice summary:
>
> http://whathecode.wordpress.com/2011/02/10/camelcase-vs-underscores-scientific-showdown/
To summarize the key points of the two papers referenced in this thread:
Blinky 2009: Participants were trained in camelCase. camelCase was
13.5% slower, 51.5% more accurate on an identifying task.
Sharif 2010: Participants were trained in underscores. Same accuracy,
camelCase was 20% slower.
It seems like, generalizing, camelCase is slower and more accurate,
while training affects both speed and accuracy.
But, really, there is no compelling scientific argument here. It really
boils down to CONSISTENCY:
1) If the existing code uses one or the other, follow the original code
to preserve CONSISTENCY.
2) If you're starting a new project, follow PEP8 (or the standards for
the language you're using) to preserve CONSISTENCY.
More information about the Python-Dev
mailing list