[Mono-list] Style

Gaurav Vaish gvaish@iitk.ac.in
Sat, 2 Mar 2002 20:46:06 +0530


----- Original Message -----
From: "Martin Baulig" <martin@gnome.org>
To: "Dwivedi , Ajay Kumar" <AjayKumar.Dwivedi@dresdner-bank.com>
Cc: "'Eric Kidd'" <eric.kidd@pobox.com>; "Mono mailing list"
<mono-list@ximian.com>
Sent: Saturday, March 02, 2002 20:11
Subject: Re: [Mono-list] Style


: Well, you don't need to indent namespace and class declarations.

    The whole purpose of indentation will be lost! It not only beautifies the
code but almost helps one to detect any errors in braces-matching, and unless
you have intelligent SharpDevelop, emacs etc, you will be lost.

    Though the choice may be personal, I prefer the following:
    * Tab instead of a whitespace. If I am forced to use whitespace -- it will
be width 4.
    * Indentation with opening braces on a new line, like the one given towards
the end.
    * So, where there are any '{' / '}' brace in a line, there are only braces.
    * Even if there is only one statement to be executed in if-else, put them in
braces, like one shown below.
        -> This gives liquidity for later use, where you may like to put some
stuff. Everytime, you do, you will not have to bother about adding / deleting
those braces.

[ Thank God, one-line methods have to be written within braces, or else think
about the situation it would have been otherwise And the same thing with get /
set ].

namespace Vaish.Gaurav.Namespace
{
    public class GauravVaish
    {
        public int Property1
        {
            get
            {
                if(someCheck())
                {
                    return 0;
                } else
                {
                    return 1;
                }
            }
        }
    }
}



Cheers,
Gaurav Vaish
http://home.iitk.ac.in/student/gvaish
http://calendar.yahoo.com/mastergaurav
---------------------------------

: --
: Martin Baulig
: martin@gnome.org
:
: _______________________________________________
: Mono-list maillist  -  Mono-list@ximian.com
: http://lists.ximian.com/mailman/listinfo/mono-list