| Notice Board |
那一天,我不得已上路。..... 在路上,只为温暖我的人。-<在路上〉歌词
|
| -- 2007-11-14 13:27:28 |
View Mode: Normal | Article List
January, 2006 | 1
Juval Lowy-编码规范-编码实践篇
[ 2006-01-11 01:00:43 | Author: ccBoy ]
Coding Practices
Read More...
- 1. Avoid putting multiple classes in a single file.
- 2. A single file should contribute types to only a single namespace. Avoid having multiple namespaces in the same file.
- 3. Avoid files with more than 500 lines (excluding machine-generated code).
- 4. Avoid methods with more than 25 lines.
- 5. Avoid methods with more than five arguments. Use structures for passing multiple arguments.
- 6. Lines should not exceed 80 characters.
- 7. Do not manually edit any machine-generated code.
- 8. Avoid
a. If modifying machine-generated code, modify the format and style to match this coding standard.
b. Use partial classes whenever possible to factor out the maintained portions.
Read More...
Tags: VisualStudio2005 |
Category: 我学我评我测我体验 |
Permalink |
Comments: 1 |
Trackbacks: 191 |
Views: 34097
Juval Lowy-编码规范-代码命名篇
[ 2006-01-11 00:13:42 | Author: ccBoy ]
Naming Conventions and Styles
Read More...
- 1. Use Pascal casing for type and method names and constants:public class SomeClass{
const int DefaultSize = 100;
public SomeMethod( )
{}
} - 2. Use camel casing for local variable names and method arguments:int number;void MyMethod(int someNumber)
{} - 3. Prefix interface names with I:interface IMyInterface{..}
- 4. Prefix private member variables with m_.
- 5. Suffix custom attribute classes with Attribute.
- 6. Suffix custom exception classes with Exception.
- 7. Name methods using verb/object pairs, such as ShowDialog( ).
Read More...
Tags: VisualStudio2005 |
Category: 我学我评我测我体验 |
Permalink |
Comments: 4 |
Trackbacks: 482 |
Views: 38080
1







