[Freeipa-devel] C++ Style Guide

Dmitri Pal dpal at redhat.com
Fri Jun 19 17:12:22 UTC 2009


John Dennis wrote:
> Our coding style guides are referenced on our wiki here:
> http://freeipa.com/page/Contribute#Developer_Documentation
>
> However they do not discuss C++ style. Since I'm writing a fair amount
> of C++ code (in part forced by the fact the AMQP client code only has
> a C++ binding, not C) it's time define our style conventions for C++.
>
> I propose is following the Google C++ style guide:
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
>
> It seems reasonable and it's influential. It seems to follow many
> common conventions and eschews the junk associated with the Microsoft
> C++ conventions.
>
> Since I don't want to write a style guide from scratch and the Google
> C++ style guide seems like a reasonable pick I propose we just
> reference the Google guide and be done with it.
>
> Anybody have any problems with this proposal? Comments? Flames?
>
> If not I'll just update the wiki to point to the Google guide.
>
> P.S.: C and C++ are such different languages despite superficial
> similarities it would be inappropriate IMHO for our C++ style to
> derive from our C style guide, they should be independent reflecting
> the inherent differences between the languages.
>
Couple points.
It would be a bit easy to understand and check if there were a sample
code snippet that would match the style guide.

I scanned through the guide and a bit concerned about names for methods
and variables.
I think these should be consistent between C and C++ otherwise we will
be creating problems for ourselves.
Also we should use same rules about spaces indentation positioning of
braces and brackets.
If we have different styles for those we will create hard time for
ourselves.
So I woulds suggest that we use this style guide only for specific
things relates to C++ and define naming convention for methods and
classes based on the style we already use.



-- 
Thank you,
Dmitri Pal

Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




More information about the Freeipa-devel mailing list