C# Coding Style Guide
This document may be read as a guide to writing robust and reliable programs. It focuses on programs written in C#, but many of the rules and principles are useful even if you write in another programming language.
…
4.2 Single Line Comments
You should use the // comment style to “comment out” code (SharpDevelop has a key for it, Alt+/) . It may be used for commenting sections of code too. Single line comments must be indented to the indent level when they are used for code documentation. Commented out code should be commented out in the first line to enhance the visibility of commented out code. A rule of thumb says that generally, the length of a comment should not exceed the length of the code explained by too much, as this is an indication of too complicated, potentially buggy, code.
…
Generally the use of underscore characters inside names and naming according to the guidelines for Hungarian notation are considered bad practice. Hungarian notation is a defined set of pre and postfixes which are applied to names to reflect the type of the variable. This style of naming was widely used in early Windows programming, but now is obsolete or at least should be considered deprecated. Using Hungarian notation is not allowed if you follow this guide. And remember: a good variable name describes the semantic not the type.
…
Website: www.icsharpcode.net | Filesize: 264kb
No of Page(s): 13
Click here to download C# Coding Style Guide.
Related Tutorial
Tags: .NET, basic language, coding standards, commenting
Comments
Leave a Reply