Am 04.08.2010 um 13:15 schrieb Jeremy Orlow:

On Wed, Aug 4, 2010 at 9:29 AM, Nikolas Zimmermann <zimmermann@physik.rwth-aachen.de> wrote:
Good morning WebKit crowd,

I'd like to discuss some style issues, that I'm frequently unsure about:

1. namespace closing brace
It was discussed in http://article.gmane.org/gmane.os.opendarwin.webkit.devel/10563, but with no real result.

When writing headers, do we need the "// namespace Foo" comment after the namespace closing brace? I think it's visual noise and would like to see a style rule that forbids it.
(A rule that says we need this would also be fine with me, as long as we write it down. But I'd vote for removing those comments, I don't trust them anyways, if I'm unsure.)

namespace WebCore {
...
} // namespace WebCore

2. ENABLE(FOO) #endif comments

#if ENABLE(FOO)
..
#endif // ENABLE(FOO)

Shall we remove the comment, or require it explicitely in the style rules?

3. Inclusion order

Say Foo.h is guarded with ENABLE(FOO) macros
Foo.h:
#if ENABLE(FOO)
namespace WebCore {

class Foo...

}
#endif

What's the correct inclusion order in Foo.cpp:
#include "config.h"
#include "Foo.h"

#if ENABLE(FOO)
..
#endif

or

#include "config.h"
#include "Foo.h"

#if ENABLE(FOO)
..
#endif

I don't see the difference between these two examples.

Oops, sorry I meant to write:

#include "config.h"
#include "Foo.h"

#if ENABLE(FOO)

or

#include "config.h"

#if ENABLE(FOO)
#include "Foo.h"
...

sorry for the confusion.

Cheers,
Niko