Mediaportal C# programming guidelines (1 Viewer)

Smirnuff

Portal Pro
December 7, 2004
630
3
United Kingdom
Vic said:
P.S - Visual Studio can tabify code easily. Just hit CTRL+A to select all and then go to Edit->Advanced->Tabify Selection.

Ctrl+K, Ctrl+F also does a good job of formatting (as per user preferences) the selection.

I also find 4 spaces to work best with my aging eyes.
 
M

Myyz

Guest
on public vs private fields and properties and all

Myself I have come to prefer in stead of this:

public class SomeClass
{
private int m_Playlist;

public int Playlist { get { return m_Playlist; } set { m_Playlist = value; } }
}

public class SomeClass
{
private int m_Playlist;

public int Playlist
{
get { return m_Playlist; }
set { m_Playlist = value; }
}
}

This way of indenting and whitespacing in our coding peoples opinion seems to allow readability whilst not one-lining stuff just like above.
A bit shorter than Frodo's recommended way, which I guess one should use when playing with his stuff, on the other hand thicker than the one-lined.

I guess it kind of comes down to what one is used to reading, if it were all UML than it would be kind of obvious.
I mean logically it's all the same construct anyway.

Some people (devs or almost people anyway=) seem to like separating things like this:
//private vals
#region PrivateInternallyUsables
private int m_streamSpeed; // integer for stream thickness in bytes
private int m_transferBufferSize; //int for stream transfer buffer size in bytes
#endregion

//public accessors
#region Accessors
public int StreamSpeed
{
get{;}
set{;}
}
public int TransferBufferSize
{
get{;}
set{;}
}
#endregion


In the end, I feel one should use what one is comfortable with.
BUT; following the guidelines laid down by the holiest of holies, the person , responsible for the project. In this case I guess Frodo. Because essentially when you have a point, he will pick it up and put it in the next version of the guidelines.
 

LastMar

Portal Pro
November 17, 2004
74
0
Re: on public vs private fields and properties and all

Myyz said:
Myself I have come to prefer in stead of this:

public class SomeClass
{
private int m_Playlist;

public int Playlist { get { return m_Playlist; } set { m_Playlist = value; } }
}

public class SomeClass
{
private int m_Playlist;

public int Playlist
{
get { return m_Playlist; }
set { m_Playlist = value; }
}
}

This way of indenting and whitespacing in our coding peoples opinion seems to allow readability whilst not one-lining stuff just like above.
A bit shorter than Frodo's recommended way, which I guess one should use when playing with his stuff, on the other hand thicker than the one-lined.

I guess it kind of comes down to what one is used to reading, if it were all UML than it would be kind of obvious.
I mean logically it's all the same construct anyway.

Some people (devs or almost people anyway=) seem to like separating things like this:
//private vals
#region PrivateInternallyUsables
private int m_streamSpeed; // integer for stream thickness in bytes
private int m_transferBufferSize; //int for stream transfer buffer size in bytes
#endregion

//public accessors
#region Accessors
public int StreamSpeed
{
get{;}
set{;}
}
public int TransferBufferSize
{
get{;}
set{;}
}
#endregion


In the end, I feel one should use what one is comfortable with.
BUT; following the guidelines laid down by the holiest of holies, the person , responsible for the project. In this case I guess Frodo. Because essentially when you have a point, he will pick it up and put it in the next version of the guidelines.

I personally like things to be indented.... but since I don't write code for this project, it doesn't matter to me... heh
 

Users who are viewing this thread

Top Bottom