[Mono-list] Style
Dan Lewis
dihlewis@yahoo.co.uk
Fri, 1 Mar 2002 09:53:40 +0000 (GMT)
--- Miguel de Icaza <miguel@ximian.com> wrote:
> For any public methods, we follow the Microsoft guidelines (just to be
> compatible).
Just a point here on the Microsoft API. While I really appreciate the rigor
with which they imposed the Pascal casing and naming conventions to the
methods, properties and class names, their argument names suck. I've seen a
mixture of UNIX style vryshrtargnms, Hungarian style lpArgumntNames,
verbosesamecasestyle, javaStyleCamelCaseArguments, and maybe even a few
underlines thrown in there for good measure. This is one point where I would
not like to follow the MS docs, and perhaps we could standardise on something
here (maybe camel or underline, please not hungarian ;), seeing as argument
names are meant to be somewhat descriptive.
Also, seeing as how one of the underlying themes of the style conventions so
far seems to be to save vertical space, here's a style which I've been using
for non-complicated property accessors. Instead of:
bool MyProperty {
get {
return x;
}
set {
x = value;
}
}
Becomes:
bool MyProperty {
get { return x; }
set { x = value; }
}
It saves 5 lines, but perhaps you feel it's just plain ugly :)
I'd also like to say that I think a consistent and thorough set of coding
conventions is a smart idea, considering how often we all work on each others
code. Ninja programmers should be able to change their style as effortlessly as
Bruce Lee changes his :)
Dan.
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com