[Mono-devel-list] mono style guidelines

Fawad Halim fawad at fawad.net
Thu Mar 4 12:30:30 EST 2004


The ECMA docs seem to use

class Foo
{
    public int Bar() {
    }
}

but most of the C# code done on VS.NET has

class Foo
{
    public int Bar()
    {
    }
}

because VS.NET defaults to that.

Would it make sense to do a GNU indent profile for mono-style?

-fawad

Ben Maurer wrote:

>I think the most endorsed style is:
>
>namespace T {
>     class Foo {
>          public void Blah ()
>          {
>              if (foo) {
>              }
>          }
>          public int Bar {
>              get { return 1; }
>          }
>     }
>}
>
>The *ONLY* place where teh brace goes on the next line is for a method/.ctor
>
>I don't think //constructors above should be used. If you really need something, use #region.
>
>Linebreaks should be at the writer's discression. In general, they should not be done at column x, but rather at a point where it increases readibility.
>
>File-ends is a trivial issue, i dont care :-).
>
>Avoiding spaces at the end of a non-empty line is a good thing. For ws only lines, either way should be fine.
>
>Error messages is a trivial problem.
>
>Empty ctors should not exist if they are not needed (remember there is a default public ctor). Otherwise, i would suggest
>public T () {}
>
<SNIP />



More information about the Mono-devel-list mailing list