[Mono-list] Style

Piers Haken piersh@friskit.com
Fri, 1 Mar 2002 02:38:46 -0800


Not really wanting to contribute to the flame war that will surely
ensure, but... I have to agree with you here. If for no other reason
that sample code and style guidelines for the .NET framework already
exist and deviating from those will just introduce unnecessary
inconsistencies. The body of programmers that are currently adopting the
.NET technologies are mostly those that have already adopted other
Microsoft technologies, are using Microsoft documentation, sample code
to learn and expect a certain style. If you want to make the transition
from windows to UNIX as smooth as possible then you should make it easy
for them to do so. After all that what it's all about, right?
Developers, developers, developers???

I'm also in the 'braces on the same line' camp. But I think that the
religious argument is less important than the pragmatic one. I'm also in
the hungarian camp (eg. http://go-mono.com/cm/cormissing.js) but I
wouldn't argue that it be adopted for Mono for the same reasons.

Piers.

-----Original Message-----
From: Patrik Torstensson [mailto:totte@labs2.com] 
Sent: Friday, March 01, 2002 12:56 AM
To: Jason Diamond; Mono-List
Subject: RE: [Mono-list] Style


Hm.

Why don't we just follow the MS guidelines of coding to the framework.

They also include formating guidelines (if I remember correct).

(personally, the new guidelines sucks! They mess up the code.)

- Patrik

> -----Original Message-----
> From: Jason Diamond [mailto:jason@injektilo.org]
> Sent: den 1 mars 2002 09:42
> To: Mono-List
> Subject: Re: [Mono-list] Style
> 
> 
> Thanks for the updated guidelines! But there are some
> constructs that I'm still not sure about:
> 
> (I'm just guessing as to what you might want in these
> examples. Please correct me.)
> 
> // try/catch/finally
> // braces on the same line?
> try {
>     Foo ();
> } catch {Exception e) {
>     Bar ();
> }
> 
> // switch
> // indent the cases?
> switch {
>     case 0:
>         Foo ();
>         break;
>     default:
>         Bar ();
>         break;
> }
> 
> // indexer
> // space before the open bracket?
> string this [int i] {
>     get {
>         return foo;
>     }
> }
> 
> // what about invoking an indexer or array?
> // space before the open bracket?
> string foo = bar [1];
> 
> // namespace
> // brace on the same line?
> namespace System {
> }
> 
> // how do we indent long parameters?
> void Method (int this, string method, bool has, char way, float too,
>     double many, byte parameters)
> {
> }
> 
> // i actually prefer this
> void Method (
>     int this,
>     string method,
>     bool has,
>     char way,
>     float too,
>     double many,
>     byte parameters)
> {
> }
> // but you guys seem very whitespace conscious.
> 
> What about naming guidelines? PascalCase, camelCase,
> _leading_underscores?
> 
> Should the example for "Missing implementation bits" throw
> NotImplementedException instead of a generic Exception?
> 
> I'm not trying to start any sort of debate. I just want to
> know what you want so that I can make sure to give it to you. :-)
> 
> Thanks,
> Jason
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 

_______________________________________________
Mono-list maillist  -  Mono-list@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list