You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by aconway <ac...@redhat.com> on 2015/06/09 20:47:06 UTC

C++ binding naming conventions: Qpid vs. C++

C++ standard library uses lowercase_and_underscores, but Qpid C++
projects to date use JavaWobbleCaseIndentifiers. Is the C++ binding the
time to start writing C++ like C++ programmers? Or will somebody's head
explode if class names start with a lower case letter?

In particular since the proton C library is written in typical
c_style_with_underscores, I am finding the CamelCase in the C++ binding
to be an ugly clash.

DoesAnybodyReallyThinkThis is_easier_to_read_than_this?

Cheers,
Alan.

Re: C++ binding naming conventions: Qpid vs. C++

Posted by aconway <ac...@redhat.com>.
On Wed, 2015-06-10 at 09:41 -0400, Chuck Rolke wrote:
> The .NET binding on top of Qpid C++ Messaging library had the same 
> problem.
> cjansen suggested that the binding present a naming convention 
> consistent
> with what the binding users might expect. So that binding did not 
> simply
> copy all the C++ function and variable names but renamed them along 
> the way.
> 
> If you do a one-to-one mapping it's sometimes easier to see what 
> exactly
> the function and variable mapping is. When stuff is renamed it's 
> harder.
> 
> You are so early in the dev cycle that you can be consistent in 
> whatever
> form you choose.

Yup. C++ does not have such strong naming traditions as some languages
since it sort of grew by accident and misadventure out of C and
originally did not have any standard library written in C++ to provide
an example. However these days there is a large and widely used std
library with a clear naming convention so I'm strongly tempted to go that
way.

> 
> ----- Original Message -----
> > From: "aconway" <ac...@redhat.com>
> > To: "proton" <pr...@qpid.apache.org>
> > Sent: Tuesday, June 9, 2015 2:47:06 PM
> > Subject: C++ binding naming conventions: Qpid vs. C++
> > 
> > C++ standard library uses lowercase_and_underscores, but Qpid C++
> > projects to date use JavaWobbleCaseIndentifiers. Is the C++ binding 
> > the
> > time to start writing C++ like C++ programmers? Or will somebody's 
> > head
> > explode if class names start with a lower case letter?
> > 
> > In particular since the proton C library is written in typical
> > c_style_with_underscores, I am finding the CamelCase in the C++ 
> > binding
> > to be an ugly clash.
> > 
> > DoesAnybodyReallyThinkThis is_easier_to_read_than_this?
> > 
> > Cheers,
> > Alan.
> > 

Re: C++ binding naming conventions: Qpid vs. C++

Posted by Chuck Rolke <cr...@redhat.com>.
The .NET binding on top of Qpid C++ Messaging library had the same problem.
cjansen suggested that the binding present a naming convention consistent
with what the binding users might expect. So that binding did not simply
copy all the C++ function and variable names but renamed them along the way.

If you do a one-to-one mapping it's sometimes easier to see what exactly
the function and variable mapping is. When stuff is renamed it's harder.

You are so early in the dev cycle that you can be consistent in whatever
form you choose.

----- Original Message -----
> From: "aconway" <ac...@redhat.com>
> To: "proton" <pr...@qpid.apache.org>
> Sent: Tuesday, June 9, 2015 2:47:06 PM
> Subject: C++ binding naming conventions: Qpid vs. C++
> 
> C++ standard library uses lowercase_and_underscores, but Qpid C++
> projects to date use JavaWobbleCaseIndentifiers. Is the C++ binding the
> time to start writing C++ like C++ programmers? Or will somebody's head
> explode if class names start with a lower case letter?
> 
> In particular since the proton C library is written in typical
> c_style_with_underscores, I am finding the CamelCase in the C++ binding
> to be an ugly clash.
> 
> DoesAnybodyReallyThinkThis is_easier_to_read_than_this?
> 
> Cheers,
> Alan.
> 

Re: C++ binding naming conventions: Qpid vs. C++

Posted by Gordon Sim <gs...@redhat.com>.
On 06/10/2015 02:25 PM, aconway wrote:
> Woo-hoo! From the horses mouth ;)

In this case it's the other end of the horse that would be a more apt 
description!


Re: C++ binding naming conventions: Qpid vs. C++

Posted by aconway <ac...@redhat.com>.
On Tue, 2015-06-09 at 19:56 +0100, Gordon Sim wrote:
> On 06/09/2015 07:47 PM, aconway wrote:
> > C++ standard library uses lowercase_and_underscores, but Qpid C++
> > projects to date use JavaWobbleCaseIndentifiers. Is the C++ binding 
> > the
> > time to start writing C++ like C++ programmers? Or will somebody's 
> > head
> > explode if class names start with a lower case letter?
> > 
> > In particular since the proton C library is written in typical
> > c_style_with_underscores, I am finding the CamelCase in the C++ 
> > binding
> > to be an ugly clash.
> 
> I agree and I would go with underscores (and I'm largely responsible 
> for 
> the poor choice in qpid-cpp, sorry!).
> 

Woo-hoo! From the horses mouth ;) Anyone know a good C++ de-camelcasing
script?



Re: C++ binding naming conventions: Qpid vs. C++

Posted by Gordon Sim <gs...@redhat.com>.
On 06/09/2015 07:47 PM, aconway wrote:
> C++ standard library uses lowercase_and_underscores, but Qpid C++
> projects to date use JavaWobbleCaseIndentifiers. Is the C++ binding the
> time to start writing C++ like C++ programmers? Or will somebody's head
> explode if class names start with a lower case letter?
>
> In particular since the proton C library is written in typical
> c_style_with_underscores, I am finding the CamelCase in the C++ binding
> to be an ugly clash.

I agree and I would go with underscores (and I'm largely responsible for 
the poor choice in qpid-cpp, sorry!).