You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Konrad Grochowski <hc...@minions.org.pl> on 2014/09/26 15:03:45 UTC

C++ coding standards

Hey,

Are C++ coding standards for thrift defined anywhere? I see that lib/cpp 
looks like this 'ClassName::methodName' but compiler code look more like 
't_class_name::method_name'. I definitely prefer first style, but 
currently I'm playing around compiler. Can I use 'lib' style, assuming 
that's more recent and compiler code will move toward that look?

-Konrad

Re: C++ coding standards

Posted by Konrad Grochowski <hc...@minions.org.pl>.
That's what I also tried, but compiler is much different from lib, so I 
just wanted to be sure that lib is 'future'.

Issue created :)

-kg

W dniu 2014-09-26 15:28, Ben Craig pisze:
> I haven't seen any explicit coding standards.  I have a minor preference
> for using whatever the "local" style already is, but it isn't a large
> concern of mine.
>
> Konrad Grochowski <hc...@minions.org.pl> wrote on 09/26/2014 08:03:45 AM:
>
>> From: Konrad Grochowski <hc...@minions.org.pl>
>> To: dev@thrift.apache.org,
>> Date: 09/26/2014 08:04 AM
>> Subject: C++ coding standards
>>
>> Hey,
>>
>> Are C++ coding standards for thrift defined anywhere? I see that lib/cpp
>> looks like this 'ClassName::methodName' but compiler code look more like
>> 't_class_name::method_name'. I definitely prefer first style, but
>> currently I'm playing around compiler. Can I use 'lib' style, assuming
>> that's more recent and compiler code will move toward that look?
>>
>> -Konrad


Re: C++ coding standards

Posted by Rush Manbert <ru...@manbert.com>.
I think this veers off into territory that should be avoided for this project.

I am not against having coding standards. Not at all. But Thrift is a fairly mature product. Disregarding new language support, I suspect that the bulk of the future coding required will be bug fixes. If that is true, then the best thing to do is to preserve the style that you find in the code you are modifying. The last thing I would want to see is that someone fixes a bug in the compiler or adds a new feature and uses a style totally foreign to what was originally used.

When I delve into the compiler code I remember that it has its peculiarities and my mind shifts into "compiler dev mode". If I look at the library code I gradually shift into "library dev mode". Neither of those are what I prefer or dictate when I set the coding standards, but they maintain the original style. That's a good thing. And Heaven forbid if coding standards are written and someone decides to change existing code to conform to them. You do NOT change working, tested code just because you don't agree with its style. That's just asking for problems.

I don't usually play this card, but I am speaking from 42 years of experience writing software. I feel that you're just going to waste time and effort.

That's my 2 cents, for what it's worth.

- Rush

On Sep 26, 2014, at 6:28 AM, Ben Craig wrote:

> I haven't seen any explicit coding standards.  I have a minor preference 
> for using whatever the "local" style already is, but it isn't a large 
> concern of mine.
> 
> Konrad Grochowski <hc...@minions.org.pl> wrote on 09/26/2014 08:03:45 AM:
> 
>> From: Konrad Grochowski <hc...@minions.org.pl>
>> To: dev@thrift.apache.org, 
>> Date: 09/26/2014 08:04 AM
>> Subject: C++ coding standards
>> 
>> Hey,
>> 
>> Are C++ coding standards for thrift defined anywhere? I see that lib/cpp 
> 
>> looks like this 'ClassName::methodName' but compiler code look more like 
> 
>> 't_class_name::method_name'. I definitely prefer first style, but 
>> currently I'm playing around compiler. Can I use 'lib' style, assuming 
>> that's more recent and compiler code will move toward that look?
>> 
>> -Konrad


Re: C++ coding standards

Posted by Ben Craig <be...@apache.org>.
I haven't seen any explicit coding standards.  I have a minor preference 
for using whatever the "local" style already is, but it isn't a large 
concern of mine.

Konrad Grochowski <hc...@minions.org.pl> wrote on 09/26/2014 08:03:45 AM:

> From: Konrad Grochowski <hc...@minions.org.pl>
> To: dev@thrift.apache.org, 
> Date: 09/26/2014 08:04 AM
> Subject: C++ coding standards
> 
> Hey,
> 
> Are C++ coding standards for thrift defined anywhere? I see that lib/cpp 

> looks like this 'ClassName::methodName' but compiler code look more like 

> 't_class_name::method_name'. I definitely prefer first style, but 
> currently I'm playing around compiler. Can I use 'lib' style, assuming 
> that's more recent and compiler code will move toward that look?
> 
> -Konrad

Re: C++ coding standards

Posted by Jake Farrell <jf...@apache.org>.
Hey Konrad
We do not have a definitive style guide, but overall we try and keep
everything formatted in a similar style for the given lib that is being
worked on. As the compiler starts to move towards more stdlib standards use
I would agree that using the 'ClassName::methodName' style would be
preferred.

Can you create a ticket for style guides and lets start a page for the
website on this topic for contributors and committers

-Jake

On Fri, Sep 26, 2014 at 9:03 AM, Konrad Grochowski <hc...@minions.org.pl>
wrote:

> Hey,
>
> Are C++ coding standards for thrift defined anywhere? I see that lib/cpp
> looks like this 'ClassName::methodName' but compiler code look more like
> 't_class_name::method_name'. I definitely prefer first style, but currently
> I'm playing around compiler. Can I use 'lib' style, assuming that's more
> recent and compiler code will move toward that look?
>
> -Konrad
>