Re: [Muine] Proposal to Adopt MCS Coding Style.



On Tue, 2005-01-04 at 02:07 -0800, Tamara wrote:
> The coding-style used by MCS (Mono C# Compiler) and Gtk# differs from
> the coding-style used by Muine. I propose to adopt that coding-style
> (available at http://svn.myrealbox.com/source/trunk/mcs/CodingStyle).
> 
> This coding-style change would only apply to portions of Muine written
> in C# and would not be adopted on a wide-scale until the release of
> Muine 0.8.0.

I'm not enthusiastic about some bits, but others are good points-
detailed comments below.

> 
> Your comments are greatly appreciated.
> 
> Major differences:
> 
> * 8-space tabs (current: tab characters)
> 
> Using 8-space tabs makes the code look more consistent on different
> systems. Currently, aligning code requires the use of both tabs and
> spaces which are visually indistinguishable. If we could use only tabs
> to align things, this wouldn't be a problem but it requires both.
> 
> Read more: http://c2.com/cgi/wiki?TabsVersusSpaces

I personally don't care much about this one. As long as everything still
lines up and I still get my 8-spaces indentation in vim I'm fine with
it.

> * Camel-casing for variables (current: underscores)
> 
> The Microsoft standard for variable names is camel-case
> (variableNamesLikeThis). C-style underscore naming looks awkward in a
> C# context.

These I personally absolutely hate- and as gtk# uses underscore naming
for its private variables, I don't feel bad using them for Muine as
well.

> * Condensed properties (current: always expanded)
> 
> Single-lines for very short property gets and sets would be allowed.
> 
> public int Number {
>         get { return num; }
>         set { num = value; }
> }

Agreed. Did this on most of the code today.

> * On<event> naming scheme for Event Handlers (current: Handle<event>)
> 
> The Gtk# standard for event handler naming is On<event>. If the widget
> is not current class then On<widget><event> is used, these should not
> be public. If you feel it should be public, consider splitting the
> widget off into its own class.

Agreed.. I'll add it to the TODO.

> * I<descriptor> naming scheme for Interfaces (current: <noun>Interface)
> 
> Muine just added SongInterface and PlayerInterface as part of
> PluginLib. According to the MS guidelines, these should be named ISong
> and IPlayer.

Good one. Did this too today.

> The "descriptor" could be a descriptive noun, noun phrase, or adjective.
> 
> Read more: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconinterfacenamingguidelines.asp
> 
> * C++-style comments (current: mainly C-style)
> 
> C-style comments ("/* ... */") look rather awkward in C++ and C#
> settings. C++-style comments ("// ...") would be cleaner.

I personally find C-style comments a lot more comfortable for multi-line
comments, and as the copyright blocks are in C-style comments I think we
can just allow both.


Cheers,
Jorn




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]