[Openerp-community] CamelCase

classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Openerp-community] CamelCase

sebastien beau
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? 


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Guewen Baconnier @ Camptocamp
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



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Stefan Rijnhart (Therp)
In reply to this post by sebastien beau
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
> <https://code.launchpad.net/%7Ecamptocamp/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?
>

+1, especially as OpenERP core code seems to be moving towards this.
From some of the new modules in trunk addons:

website_blog/models/website_blog.py:class Blog
website_blog/models/website_blog.py:class BlogTag
website_blog/models/website_blog.py:class BlogPost
website_blog/models/website_blog.py:class BlogPostHistory
website_crm_partner_assign/models/website.py:class Website
website_event_sale/models/website.py:class Website
website_mail/models/mail_thread.py:class MailThread
website_mail/models/mail_message.py:class MailMessage
website_mail/models/email_template.py:class EmailTemplate
website_partner/models/website.py:class Website
website_partner/models/res_partner.py:class WebsiteResPartner
website_partner/models/res_company.py:class WebsiteResCompany
website_sale/models/website.py:class Website
website_sale/models/payment_transaction.py:class PaymentTransaction
website_sale/models/sale_order.py:class SaleOrder
website_sale/models/sale_order.py:class SaleOrderLine
website_sale_crm/models/website.py:class Website
website_sale_delivery/models/website.py:class Website
website_sale_delivery/models/sale_order.py:class SaleOrder

Cheers,
Stefan.


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Alexandre Fayolle - camptocamp
In reply to this post by sebastien beau
On 04/04/2014 11:05, 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? 



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

People will have to change their grepping habits, and it means a significant change in coding style between OCA addons and the official addons.

-0 for me

-- 
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Alexandre Fayolle - camptocamp
In reply to this post by Stefan Rijnhart (Therp)
On 04/04/2014 11:25, Stefan Rijnhart wrote:

> 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
>> <https://code.launchpad.net/%7Ecamptocamp/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?
>>
> +1, especially as OpenERP core code seems to be moving towards this.
> From some of the new modules in trunk addons:
>
> website_blog/models/website_blog.py:class Blog
> website_blog/models/website_blog.py:class BlogTag
> website_blog/models/website_blog.py:class BlogPost
> website_blog/models/website_blog.py:class BlogPostHistory
> website_crm_partner_assign/models/website.py:class Website
> website_event_sale/models/website.py:class Website
> website_mail/models/mail_thread.py:class MailThread
> website_mail/models/mail_message.py:class MailMessage
> website_mail/models/email_template.py:class EmailTemplate
> website_partner/models/website.py:class Website
> website_partner/models/res_partner.py:class WebsiteResPartner
> website_partner/models/res_company.py:class WebsiteResCompany
> website_sale/models/website.py:class Website
> website_sale/models/payment_transaction.py:class PaymentTransaction
> website_sale/models/sale_order.py:class SaleOrder
> website_sale/models/sale_order.py:class SaleOrderLine
> website_sale_crm/models/website.py:class Website
> website_sale_delivery/models/website.py:class Website
> website_sale_delivery/models/sale_order.py:class SaleOrder
>
>

Missed this.

<rant>I really wish the core team of OpenERP would make clear moves with
regard to coding conventions, especially those who have very little
negative impact (as it is rare to import a Model class in an addon, and
migrating to v8 means changing code anyway for community addons). There
is still code in trunk using osv.osv as the base class, and the
resulting inconsistencies make the life of everyone more incomfortable
than it should. </rant>

This being said, and with the move pointed out by Stefan in mind, I
change my previous vote to +1 for changing this in OCA addons.



--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Pedro Manuel Baeza Romero
In reply to this post by Stefan Rijnhart (Therp)
I also support the change to CapWords (CamelCase), because we can consider consistency in multiple levels: you can be consistent across a file, a module or an entire project. There are several full modules already working with this convention (for example, account_statement_base_import module and family on bank-statement-reconcile branch). If we are changing progressively modules to this convention, we will be in a future near of the project level consistency, but at least on the module level.

Take in mind also that this doesn't generate any side effect, because the name of the class is not so important for OpenERP (just for calls on Python code).

We can put this as a requirement for new added modules, and desirable for existing ones.

Regards.


2014-04-04 11:25 GMT+02:00 Stefan Rijnhart <[hidden email]>:
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
> <https://code.launchpad.net/%7Ecamptocamp/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?
>

+1, especially as OpenERP core code seems to be moving towards this.
From some of the new modules in trunk addons:

website_blog/models/website_blog.py:class Blog
website_blog/models/website_blog.py:class BlogTag
website_blog/models/website_blog.py:class BlogPost
website_blog/models/website_blog.py:class BlogPostHistory
website_crm_partner_assign/models/website.py:class Website
website_event_sale/models/website.py:class Website
website_mail/models/mail_thread.py:class MailThread
website_mail/models/mail_message.py:class MailMessage
website_mail/models/email_template.py:class EmailTemplate
website_partner/models/website.py:class Website
website_partner/models/res_partner.py:class WebsiteResPartner
website_partner/models/res_company.py:class WebsiteResCompany
website_sale/models/website.py:class Website
website_sale/models/payment_transaction.py:class PaymentTransaction
website_sale/models/sale_order.py:class SaleOrder
website_sale/models/sale_order.py:class SaleOrderLine
website_sale_crm/models/website.py:class Website
website_sale_delivery/models/website.py:class Website
website_sale_delivery/models/sale_order.py:class SaleOrder

Cheers,
Stefan.


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Davide Corio-2
In reply to this post by Stefan Rijnhart (Therp)
On 04 Apr 2014, at 11:25, Stefan Rijnhart <[hidden email]> wrote:
>
> +1, especially as OpenERP core code seems to be moving towards this.
> From some of the new modules in trunk addons:

as Alexander said, this would requires some “grepping habits” changes.
i wouldn’t like to have to grep twice to search for some classes just because
the original one is my_class and the inherited one is MyClass.

But if OpenERP is gonna move toward this too you get another +1

--
Davide Corio
[hidden email]
ERP Consultant
L.S. Advanced Software Srl



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

jeff.wang-2
In reply to this post by Guewen Baconnier @ Camptocamp
Hi All,

Totally agree, underscore is working well, CamelCase make no sense.

------------------
Jeff Wang |  [hidden email] | 18016291663 | 02158980787
@OpenERP_Jeff "As simple as possible, As complex as needed"
Maintainer of Open ERP china community 
http://www.openerp-china.org
 


------------------ Original ------------------
From:  "Guewen Baconnier";<[hidden email]>;
Date:  Fri, Apr 4, 2014 05:25 PM
To:  "openerp-community"<[hidden email]>;
Subject:  Re: [Openerp-community] 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



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Leonardo Pistone - camptocamp
In reply to this post by Davide Corio-2
Since as Stefan points out, SA is doing the same thing, and since you can grep for the _name instead of the  class name, I vote +1.


On Fri, Apr 4, 2014 at 11:39 AM, Davide Corio <[hidden email]> wrote:
On 04 Apr 2014, at 11:25, Stefan Rijnhart <[hidden email]> wrote:
>
> +1, especially as OpenERP core code seems to be moving towards this.
> From some of the new modules in trunk addons:

as Alexander said, this would requires some “grepping habits” changes.
i wouldn’t like to have to grep twice to search for some classes just because
the original one is my_class and the inherited one is MyClass.

But if OpenERP is gonna move toward this too you get another +1

--
Davide Corio
[hidden email]
ERP Consultant
L.S. Advanced Software Srl



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

David BEAL
In reply to this post by Pedro Manuel Baeza Romero
All is said here.

OCA can have the full PEP8 standard.

+1

David BEAL
Akretion
OpenERP Development - Integration
+33 (0)6 67 22 86 89
+33 (0)4 82 53 84 60


2014-04-04 11:39 GMT+02:00 Pedro Manuel Baeza Romero <[hidden email]>:

> I also support the change to CapWords (CamelCase), because we can consider
> consistency in multiple levels: you can be consistent across a file, a
> module or an entire project. There are several full modules already working
> with this convention (for example, account_statement_base_import module and
> family on bank-statement-reconcile branch). If we are changing progressively
> modules to this convention, we will be in a future near of the project level
> consistency, but at least on the module level.
>
> Take in mind also that this doesn't generate any side effect, because the
> name of the class is not so important for OpenERP (just for calls on Python
> code).
>
> We can put this as a requirement for new added modules, and desirable for
> existing ones.
>
> Regards.
>
>
> 2014-04-04 11:25 GMT+02:00 Stefan Rijnhart <[hidden email]>:
>
>> 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
>> >
>> > <https://code.launchpad.net/%7Ecamptocamp/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?
>> >
>>
>> +1, especially as OpenERP core code seems to be moving towards this.
>> From some of the new modules in trunk addons:
>>
>> website_blog/models/website_blog.py:class Blog
>> website_blog/models/website_blog.py:class BlogTag
>> website_blog/models/website_blog.py:class BlogPost
>> website_blog/models/website_blog.py:class BlogPostHistory
>> website_crm_partner_assign/models/website.py:class Website
>> website_event_sale/models/website.py:class Website
>> website_mail/models/mail_thread.py:class MailThread
>> website_mail/models/mail_message.py:class MailMessage
>> website_mail/models/email_template.py:class EmailTemplate
>> website_partner/models/website.py:class Website
>> website_partner/models/res_partner.py:class WebsiteResPartner
>> website_partner/models/res_company.py:class WebsiteResCompany
>> website_sale/models/website.py:class Website
>> website_sale/models/payment_transaction.py:class PaymentTransaction
>> website_sale/models/sale_order.py:class SaleOrder
>> website_sale/models/sale_order.py:class SaleOrderLine
>> website_sale_crm/models/website.py:class Website
>> website_sale_delivery/models/website.py:class Website
>> website_sale_delivery/models/sale_order.py:class SaleOrder
>>
>> Cheers,
>> Stefan.
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openerp-community
>> Post to     : [hidden email]
>> Unsubscribe : https://launchpad.net/~openerp-community
>> More help   : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : [hidden email]
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp
>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Yannick Vaucher @ Camptocamp
In reply to this post by Leonardo Pistone - camptocamp
+1

As Leonardo already said it, class might not be conventional enough. It's better to grep on _name and _inherit. I don't recall having grepped on a Class name.

I'm also for a change toward CamelCase


On Fri, Apr 4, 2014 at 11:54 AM, Leonardo Pistone <[hidden email]> wrote:
Since as Stefan points out, SA is doing the same thing, and since you can grep for the _name instead of the  class name, I vote +1.


On Fri, Apr 4, 2014 at 11:39 AM, Davide Corio <[hidden email]> wrote:
On 04 Apr 2014, at 11:25, Stefan Rijnhart <[hidden email]> wrote:
>
> +1, especially as OpenERP core code seems to be moving towards this.
> From some of the new modules in trunk addons:

as Alexander said, this would requires some “grepping habits” changes.
i wouldn’t like to have to grep twice to search for some classes just because
the original one is my_class and the inherited one is MyClass.

But if OpenERP is gonna move toward this too you get another +1

--
Davide Corio
[hidden email]
ERP Consultant
L.S. Advanced Software Srl



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--
Yannick Vaucher
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 30
Office: +41 21 619 10 10

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

eLBatti
In reply to this post by sebastien beau
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 
> <https://code.launchpad.net/%7Ecamptocamp/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?

+1

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Francesco Apruzzese
In reply to this post by jeff.wang-2
+1 for jeff.wang

Il 04/04/2014 11:47, jeff.wang ha scritto:
Hi All,

Totally agree, underscore is working well, CamelCase make no sense.

------------------
Jeff Wang |  [hidden email] | 18016291663 | 02158980787
@OpenERP_Jeff "As simple as possible, As complex as needed"
Maintainer of Open ERP china community 
 


------------------ Original ------------------
From:  "Guewen Baconnier";[hidden email];
Date:  Fri, Apr 4, 2014 05:25 PM
To:  "openerp-community"[hidden email];
Subject:  Re: [Openerp-community] 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



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Alexandre Fayolle - camptocamp

On 04/04/2014 13:22, Francesco Apruzzese wrote:
+1 for jeff.wang



That's not how voting is done. If you are against the proposal, you say "-1".


-- 
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

gianluca milano
In reply to this post by jeff.wang-2
Hi all,

IMHO underscore is more readable. But, I’m an OpenERP newbie, so I easily can adapt.

Anyway to me is -1

gianlucamilanoGianluca Milano  | Business Integrator 
+39 081 194 65 159 | +39 335 60 10 512
gianlucamilano 
| Via Trepiccioni, 39 - 80078 Pozzuoli (NA) - ITALY

P.IVA IT07227561219  
WebsiteGB   [hidden email]    Vcard Save Contact   View map   Twitter button



Il giorno 04/apr/2014, alle ore 11:47, jeff.wang <[hidden email]> ha scritto:

Hi All,

Totally agree, underscore is working well, CamelCase make no sense.

------------------
Jeff Wang |  [hidden email] | 18016291663 | 02158980787
@OpenERP_Jeff "As simple as possible, As complex as needed"
Maintainer of Open ERP china community 
 


------------------ Original ------------------
From:  "Guewen Baconnier";<[hidden email]>;
Date:  Fri, Apr 4, 2014 05:25 PM
To:  "openerp-community"<[hidden email]>;
Subject:  Re: [Openerp-community] 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



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
gianlucamilanoGianluca Milano  | Business Integrator 
+39 081 194 65 159 | +39 335 60 10 512
gianlucamilano 
| Via Trepiccioni, 39 - 80078 Pozzuoli (NA) - ITALY

P.IVA IT07227561219  
WebsiteGB       Vcard Save Contact   View map   Twitter button   

 

Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

nicothebrush
I don't like CamelCase very much, better underscore and all lower case...


On 04/04/2014 14:08, Gianluca Milano wrote:
Hi all,

IMHO underscore is more readable. But, I’m an OpenERP newbie, so I easily can adapt.

Anyway to me is -1

gianlucamilano
Gianluca Milano  | Business Integrator 
+39 081 194 65 159 | +39 335 60 10 512
gianlucamilano 
| Via Trepiccioni, 39 - 80078 Pozzuoli (NA) - ITALY

P.IVA IT07227561219  
WebsiteGB   [hidden email]    Vcard Save
                      Contact   View map   Twitter button



Il giorno 04/apr/2014, alle ore 11:47, jeff.wang <[hidden email]> ha scritto:

Hi All,

Totally agree, underscore is working well, CamelCase make no sense.

------------------
Jeff Wang |  [hidden email] | 18016291663 | 02158980787
@OpenERP_Jeff "As simple as possible, As complex as needed"
Maintainer of Open ERP china community 
 


------------------ Original ------------------
From:  "Guewen Baconnier";<[hidden email]>;
Date:  Fri, Apr 4, 2014 05:25 PM
To:  "openerp-community"<[hidden email]>;
Subject:  Re: [Openerp-community] 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



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

--
Micronaet e-mail


nicola riolini
[area tecnica]

Concessionario Autorizzato Passepartout Mexal micronaet s.r.l.

sede operativa:
via iv novembre 264
25010 borgosatollo (bs)

tel./fax +39 030 2501517

<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script> <a href="skype:rn.micronaet?call">Skype Status call me skype (utente skype: rn.micronaet)

ATTENZIONE: Il contenuto di questo messaggio e rivolto unicamente alle persone cui è indirizzato e può contenere informazioni la cui riservatezza è tutelata legalmente. Ne sono vietati la riproduzione, la diffusione e l'uso in mancanza di autorizzazione del destinatario. Se l'avete ricevuto per errore vogliate eliminare il messaggio in modo permanente e darcene cortesemente notizia. Analizzate sempre gli allegati prima di aprirli.



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Info SHS-AV
In reply to this post by Francesco Apruzzese
I prefer CamelCase.
In my mind is better

Antonio M. Vigliotti



Il 04/04/2014 13:22, Francesco Apruzzese ha scritto:
+1 for jeff.wang

Il 04/04/2014 11:47, jeff.wang ha scritto:
Hi All,

Totally agree, underscore is working well, CamelCase make no sense.

------------------
Jeff Wang |  [hidden email] | 18016291663 | 02158980787
@OpenERP_Jeff "As simple as possible, As complex as needed"
Maintainer of Open ERP china community 
 


------------------ Original ------------------
From:  "Guewen Baconnier";[hidden email];
Date:  Fri, Apr 4, 2014 05:25 PM
To:  "openerp-community"[hidden email];
Subject:  Re: [Openerp-community] 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



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Andrea Cometa
In reply to this post by nicothebrush
Il 04/04/2014 14:56, Nicola Riolini ha scritto:
I don't like CamelCase very much, better underscore and all lower case...


On 04/04/2014 14:08, Gianluca Milano wrote:
Hi all,

IMHO underscore is more readable. But, I’m an OpenERP newbie, so I easily can adapt.

Anyway to me is -1

after 4 years developing with underscore and lower case, why change everything?
I think this makes no sense, even more so if we have to spend a period of transition, where in some cases we write with an underscore and others with CameCase
for me is -1

--
Andrea Cometa - Consulente OpenERP, Coord Reg SIPSI
Via Platone, 24/A - 74023 - Grottaglie (TA) - Italy
Cell: 3389553466   Tel: 0999870931  Fax: 0999870217
[hidden email]     http://www.andreacometa.it
pec: [hidden email]
linkedin: http://it.linkedin.com/in/andreacometa

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Sylvain LE GAL
Hi

It could be interesting to have the point of view of OpenERP SA about that question. If they began to change for the new modules, there is maybe a good reason...

And +0.5 for CamelCase.

Regards.


Sylvain LE GAL
Service informatique
Groupement Régional Alimentaire de Proximité

3 Grande rue des feuillants 69001 Lyon
Bureau :
(+33) 09.72.32.33.17
Astreinte :
(+33) 06.81.85.61.43

Site Web : www.grap.coop
Twitter :
@legalsylvain



2014-04-04 16:07 GMT+02:00 Andrea Cometa <[hidden email]>:
Il 04/04/2014 14:56, Nicola Riolini ha scritto:
I don't like CamelCase very much, better underscore and all lower case...


On 04/04/2014 14:08, Gianluca Milano wrote:
Hi all,

IMHO underscore is more readable. But, I’m an OpenERP newbie, so I easily can adapt.

Anyway to me is -1

after 4 years developing with underscore and lower case, why change everything?
I think this makes no sense, even more so if we have to spend a period of transition, where in some cases we write with an underscore and others with CameCase
for me is -1

--
Andrea Cometa - Consulente OpenERP, Coord Reg SIPSI
Via Platone, 24/A - 74023 - Grottaglie (TA) - Italy
Cell: 3389553466   Tel: <a href="tel:0999870931" value="+33999870931" target="_blank">0999870931  Fax: <a href="tel:0999870217" value="+33999870217" target="_blank">0999870217
[hidden email]     http://www.andreacometa.it
pec: [hidden email]
linkedin: http://it.linkedin.com/in/andreacometa

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] CamelCase

Mariano Ruiz
In reply to this post by sebastien beau
I agree with Sylvain, the correct direction is follow the OpenERP SA guidelines, and if OpenERP SA will be change to CamelCase, then will be good move to this direction all community addons.


2014-04-04 11:17 GMT-03:00 Sylvain LE GAL <[hidden email]>:

Hi

It could be interesting to have the point of view of OpenERP SA about that question. If they began to change for the new modules, there is maybe a good reason...

And +0.5 for CamelCase.

Regards.


Sylvain LE GAL
Service informatique
Groupement Régional Alimentaire de Proximité

3 Grande rue des feuillants 69001 Lyon
Bureau :
(+33) 09.72.32.33.17
Astreinte :
(+33) 06.81.85.61.43

Site Web : www.grap.coop
Twitter :
@legalsylvain



2014-04-04 16:07 GMT+02:00 Andrea Cometa <[hidden email]>:
Il 04/04/2014 14:56, Nicola Riolini ha scritto:
I don't like CamelCase very much, better underscore and all lower case...


On 04/04/2014 14:08, Gianluca Milano wrote:
Hi all,

IMHO underscore is more readable. But, I’m an OpenERP newbie, so I easily can adapt.

Anyway to me is -1

after 4 years developing with underscore and lower case, why change everything?
I think this makes no sense, even more so if we have to spend a period of transition, where in some cases we write with an underscore and others with CameCase
for me is -1

--
Andrea Cometa - Consulente OpenERP, Coord Reg SIPSI
Via Platone, 24/A - 74023 - Grottaglie (TA) - Italy
Cell: 3389553466   Tel: <a href="tel:0999870931" value="+33999870931" target="_blank">0999870931  Fax: <a href="tel:0999870217" value="+33999870217" target="_blank">0999870217
[hidden email]     http://www.andreacometa.it
pec: [hidden email]
linkedin: http://it.linkedin.com/in/andreacometa

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp




--
Mariano Ruiz
Software Architect & Web Developer
http://www.mrdev.com.ar




--
Mariano Ruiz
Software Architect & Web Developer
http://www.mrdev.com.ar


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
12