[Tutor] variable naming conventions

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Aug 16 03:40:37 CEST 2015


On 16/08/2015 02:24, D Wyatt wrote:
> It seems every book I read these days uses camel case for variable names in
> Python.  I was once told that using underscores is preferred.  Is there a
> preference in the Python community or does it really matter?  I'd like to
> instill good habits while I'm learning.
>
> Thanks in advance,
>

If it's your code for your use do whatever you like.  I prefer camel 
case as it saves reaching for the SHIFT-MINUS combination, others detest 
it.  Even the famous PEP 8 (https://www.python.org/dev/peps/pep-0008/) 
is only a guide.

However if I was working on a project in collaboration with others I 
would certainly expect to stick with the standards that the project 
insisted on, even if I didn't like them personally.  Anybody who 
deliberately ignores standards in this situation should be hung, drawn 
and quartered after spending an extremely long amount of time in agony 
in The Comfy Chair :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list