why no camelCase in PEP 8?

Peter J. Holzer hjp-python at hjp.at
Thu May 28 16:09:23 EDT 2020


On 2020-05-19 09:53:01 +0100, Rhodri James wrote:
> On 18/05/2020 22:07, Eli the Bearded wrote:
> > 	camelCase	->	 noCamelCase
> > 	snake_case	->	 no_snake_case
> > 
> > One of those is easier to "grep" for than the other.
> 
> Eh.  A changed case in the one, an extra character in the other; that's
> pretty much the same difficulty really.  I certainly don't find it "hard" to
> grep for _snake_case.

I think you misunderstood his argument. He is saying that by searching
for /snake_case/ you will find both "snake_case" and "no_snake_case".
But /camelCase/ won't match "noCamelCase" - you have to search for
/[cC]amelCase/ instead.

I'm not sure if I'm convinced by that. I prefer snake_case simply for
aesthetic reasons. My native language is German, so I should be used to
gratuitous capitalisation from early childhood - but I still find
camelCase ugly.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20200528/5e352f8d/attachment.sig>


More information about the Python-list mailing list