[Mono-dev] Coding guidelines confusion on braces

Gert Driesen gert.driesen at telenet.be
Mon May 26 13:48:05 EDT 2008


Hey,

Can someone clear up the confusion on whether braces should be on the same
line as the class/namespace declaration, or on the next line?

I once committed a patch in which I moved the braces to the same line as the
declaration, and was then told it did not match the coding guidelines.

I verified this with our coding guidelines doc
(http://www.mono-project.com/Coding_Guidelines), but was told that this
document did not mention this explicitly (even though the examples clearly
use that style).

Since then, I always put them on the next line. This appears to match most
of our current sources.

My question now is simple:

Should braces for classes/namespaces be on the same line or the next line?

Depending on the answer, the coding guidelines document should be updated to
reflect this.

Note to those concerned:
I have no intention of modifying all sources accordlingly ;-)

Gert




More information about the Mono-devel-list mailing list