[webkit-dev] Some new coding style rules

Maciej Stachowiak mjs at apple.com
Wed Aug 4 13:05:48 PDT 2010


On Aug 4, 2010, at 10:43 AM, Darin Adler wrote:

> On Aug 4, 2010, at 1:29 AM, Nikolas Zimmermann wrote:
> 
>> 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
> 
> My personal preference: We should omit it.
> 
>> 2. ENABLE(FOO) #endif comments
>> 
>> #if ENABLE(FOO)
>> ..
>> #endif // ENABLE(FOO)
>> 
>> Shall we remove the comment, or require it explicitely in the style rules?
> 
> My personal preference: We should omit it.

Comments at the end of an #if block can help code readability if the #ifs are nested. 

 - Maciej



More information about the webkit-dev mailing list