Idesign releases C # programming specification, chick shooting from
Only4Gurus
After downloading, you will be determined to take a time to translate to better learn.
The contents of the directory are as follows:
Naming Conventions and flavor naming conventions and style 2 coding convention and set coding practices 3 project structure project settings and structure 4 framework guiding framework specific guidelines 4.1 special data access and data access 4.2 asp.net web service asp.net and web services 4.3 sequence Serialization 4.4 Multithreading Multithreading 4.5 Remoting Remoting 4.6 Security Security 4.7 Services Components Enterprise Services 5 Resources Resources
Today, I only translated the naming rules, the translation and the original parties are as follows, and the TIP is attached, :-)
Naming rules and style Naming Conventions and Style
1. The use of class and method names pascal style use pascal casing for type and method names public class someclass {public somemethod () {}} 2. parameters using local variables and methods from camel use camel casing for local variable names and method arguments int number ; void mymethod (int somenumber) {} 3. i interface name as a prefix using prefix interface name with i interface imyinterface {..} 4. private member variables employed m_ prefix prefix private member variables with m_ public class someclass {private int m_number;} 5. Custom attribute class name uses Attribute as the suffix suffix custom attribute class with attribute. 6. Customized exception class name uses Exception as the suffix Suffix Custom Exception Classes with Exception. 7. Using the verb-object to naming methods, for example showdialog () name methods using verb-object pair, such as showdialog () 8. the method should return a value of the return value name represents, for example getobjectstate () methods with return values should have a name describing the value returned, such as GetObjectState (). 9. Adopt a descriptive variable name. Use descriptive variable names. A) Avoid using single-letter variable names, such as i or t; but use index or temp. Avoid Single Character Variable Names, Such As I OR T. Use index or temp instead. B) Avoid using Hungarian nomenclature for public and protected members. Avoid Using Hungarian NOTATION for PUBLICOR PROTECTED MEMBERS. C) Do not use abbreviations (for example, Number abbreviations as num). Do Not Abbreviate Words (SUCH AS NUM INSTEAD OF Number). 10. Always use the C # predefined type instead of using the alias in the System namespace. For example, using Object does not have to use Object, use String without String, using int32 without INT32. Always Use C # predefined Types Rather Than The Aliases in The System Namespace. For example: Object Not Ibject String Not String Int Not Int32 11. For generics, the type is capitalized. Retain the suffix type when processing .NET type Type.
WIENERICS, USE Capital Letters for Types. RESERVE SUFFIXING TYPE WHEN DEALING WIEN DEALING WIEN DEALING WITH THE. Net TYPE. // Correct: // Correct: Public Class LinkedList / / Avoid:
// Avoid:
Public class linkedList
12. Use meaningful namespace names, such as product names or company names.
Use meaningful namespaces such as the product name or the company name.
13. Avoid using a full name of the class, but use the USING statement.
Avoid Fully Qualified Type Names. Use the using statement instead.
14. Avoid using the USING statement in the namespace.
Avoid Putting A Using Statement Inside a namespace.
15. Place all Framework namespace names, put it from the defined or third-party namespace name.
Group All Framework Namespaces TOGETHER AND PUT Custom Or Third Party Namespaces Underneath.
Using system;
Using system.collections;
Using system.componentmodel;
Using system.data;
Using mycompany;
Using myControls;
16. Adopt commissioned, do not explicitly instantiate the delegation.
Use delegate Inference Instead of Explicit Delegate Instant
Delegate void somedlegate ();
Public void someMethod ()
{}
Somedlegate somedlegate = someMethod;
17. Strictly abide by the indentation format.
Maintain strict indeentation.
a) indentation adopts 3 spaces.
Use 3 spaces for indentation.
b) Do not use Tab or non-standard indentation, such as 1, 2 or 4 spaces.
Do Not Use Tabs or Non-Standard Indentation Like 1, 2 Or 4 Spaces.
18. Note The code that is indent and its comment is on the same level.
Indent Comment At the Same Level of Indentation As The Code You Are Documenting.
19. All comments should be spell check. The annotated note indicates the development of the grassroots.
All Comments Should Pass Spell Checking. Misspelled Comments INDICATE SLOPPY development.
20. All member variables should be defined in front and attributes or methods.
All Member Variables Should Be Declared At The Top, With Line Separating Them from The Properties Or Methods.
Public Class Myclass
{
INT m_Number;
String m_name;
Public void someMethod1 () {} public void someMethod2 () {}} 21. The definition of local variables is as close as possible to its initial use. Declare a local variable as close as possible to it it .. 22. The file name should reflect the class it contains. A File Name SHOULD REFLECT The Class It Contains. 23. When using the Partial type and assigns a file per part, naming each file with a type name P and order. when using partial types and allocating a part per file, name each file after the type suffixed with ap and an ordinal number: // in myclassp1.cs public partial class myclass {} // in myclassp2.cs public partial class myclass {} 24 Left braces are always placed in the new row. ALWAYS Place An Open Curly Brace ({) in a new line. 25. Anonymous method mimics the layout of ordinary methods, and anonymous delegate definitions are placed in one line. WITH Anonymous Methods Mimic The Code Layout of a Regular Method, Aligned with The Anonymous Delegate Declaration. A) Compliance with the rules of the left bracers in the new row. comply with placing an open curly brace in a new line delegate void somedelegate (string somestring); // correct // correct: public void invokemethod () {somedelegate somedelegate = delegate (string name) {messagebox.show (name);}; Somedlegate ("juval");} // avoid use: // Avoid Public Void InvokeMethod () {somedlegate somedlegate = delegate (String name) {messagebox.show (name);}; somedlegate ("juval");} 26. Anonymous methods without parameters use empty brackets. Use Empty Parenthesis On Parameter-Less Anonymous Methods A) Only when an anonymous method may be used for any delegate, the brackets are omitted.