home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Mediaportal C# programming guidelines
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Myyz" data-source="post: 16060"><p><strong>on public vs private fields and properties and all</strong></p><p></p><p>Myself I have come to prefer in stead of this:</p><p></p><p>public class SomeClass</p><p>{</p><p> private int m_Playlist;</p><p></p><p> public int Playlist { get { return m_Playlist; } set { m_Playlist = value; } }</p><p>}</p><p></p><p>public class SomeClass</p><p>{</p><p> private int m_Playlist;</p><p></p><p> public int Playlist</p><p> {</p><p> get { return m_Playlist; }</p><p> set { m_Playlist = value; } </p><p> }</p><p>}</p><p></p><p>This way of indenting and whitespacing in our coding peoples opinion seems to allow readability whilst not one-lining stuff just like above.</p><p>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. </p><p></p><p>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.</p><p>I mean logically it's all the same construct anyway. </p><p></p><p>Some people (devs or almost people anyway=) seem to like separating things like this:</p><p>//private vals</p><p>#region PrivateInternallyUsables</p><p>private int m_streamSpeed; // integer for stream thickness in bytes</p><p>private int m_transferBufferSize; //int for stream transfer buffer size in bytes</p><p>#endregion</p><p></p><p>//public accessors</p><p>#region Accessors</p><p>public int StreamSpeed</p><p>{</p><p>get{;}</p><p>set{;}</p><p>}</p><p>public int TransferBufferSize</p><p>{</p><p>get{;}</p><p>set{;}</p><p>}</p><p>#endregion</p><p></p><p></p><p>In the end, I feel one should use what one is comfortable with. </p><p>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.</p></blockquote><p></p>
[QUOTE="Myyz, post: 16060"] [b]on public vs private fields and properties and all[/b] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Mediaportal C# programming guidelines
Contact us
RSS
Top
Bottom