On 1 Oct 2013, at 22:34, Dirk Dittmann <dirk.dittmann....@gmail.com> wrote:

> I understand and will make the improvements. Thx for the hind ! I squash the 
> commit and improve readability. Is there any code convention documentation ? 
> Which I could read? 

No, there's rules, since the codebase contains quite a mixture. We could start 
a wiki page, only things I really care about:

m_ or _ prefix for members (_prefix is widely used but technically illegal by 
ISO C++, m_ is my slight preference now)

fully brace conditions, even single line. This one is a pain but we've had 
several bugs with nested ifs-without-braces being modified and introducing 
logic errors. In several cases people forgot C++ is not Python:

if (you do this)
        if (you keep do thing)
                if (you then do this)
                        printf("terrible things can happen");
                printf("This is not python!");


I personally prefer lowerCamelCaseWithoutUnderscores for method and variable 
names, but you will find plenty of other places in the code which use 
all_lower_case - usually try to follow the style of the code you're working 

Regarding naming, longer names and fewer comments are better. Don't do:

        double m_vXr; /// the velocity tachyon flux

better do:

        double m_velocityTachyonFlux;

Of course only people with auto-completing editors agree with this! Shorter 
names are fine for locals or arguments but still aim to be descriptive.

Kind regards,

October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
Flightgear-devel mailing list

Reply via email to