Skip to content

Some questions about the Coding Guidlines #19

@theZiz

Description

@theZiz

I have some questions and unclearities about the coding guidlines.

no code alignment (only indention)
What does this mean? No code like this

int result = my_fancy_function( parameter1, parameter2, parameter3, parameter4,
                                parameter5, parameter6, parameter7 );

but this

int result = my_fancy_function( parameter1, parameter2, parameter3, parameter4,
    parameter5, parameter6, parameter7 );

?

@ax3l:

int result = my_fancy_function(
    parameter1,
    parameter2,
    // ...
    parameter7
);

code inside the deepest namespace is indented
This is missleading. What if I have such a code:

namespace foo
{
namespace traits
{
    template<
        typename T_Type
    >
    struct Bar;
} // namesspace traits

template<
    typename T_Type
>
void bar( T_Type t )
{
    traits::Bar::bar( t );
}

} // namespace foo

It fulfills the rule, but is this really the intended behaviour?

Template Class / Struct and Type Definitions
There is no explicit rule, that the opening tocken of a template parameter needs to be bing to the template keyword, such that this is forbidden:

template <
    T_Keks
>

although it makes sense in the general context. However especially with these defintions over more than one line, it it harder to spot template< than template <. The same is in fact also true for function and method definitions, but ( is slimer and therefore better to spot, so the effect is not so strong.
Is it really that important to forbid these spaces?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions