← Back to team overview

openerp-community team mailing list archive

Re: CamelCase

 

On 04/04/2014 11:05 AM, Sebastien Beau wrote:
> Hi All,
> I always hesitate to move or not on CamelCase for every class in OCA module.
> I prefer CamelCase but a lot of code do not use it.
> And sometime not using CamelCase can introduce bug and you have to rename
> the class in something different like here
> https://code.launchpad.net/~camptocamp/carriers-deliveries/7.0-change-class-name-to-avoid-error_rde/+merge/213881
> 
> Maybe it's time to move on CamelCase and update the great Nicolas Bessi
> tools to check the class name (https://github.com/nbessi/openerp-conventions
> )?
> 
> What do you think?
> 


Hi,

I totally support pep8 usually, but I'm also an advocate of consistency,
and on this point actually if we want to be consistent, we have to use
the underscore style. One of the pep8's main point is the consistency
(in the chapter "A Foolish Consistency is the Hobgoblin of Little
Minds"), stating:

«
Some other good reasons to ignore a particular guideline:
[...]
2. To be consistent with surrounding code that also breaks it (maybe for
historic reasons) -- although this is also an opportunity to clean up
someone else's mess (in true XP style).
[...]
»

That's not that important so I won't really argue about this choice, but
my opinion is that we should stick with the underscores to be
consistent. Or switch to CamelCase but propose the change on the
official addons, which sounds like to me a wasted effort that would
never be merged.


- Guewen

[0] http://legacy.python.org/dev/peps/pep-0008/#id9




Follow ups

References