Notice Board
那一天,我不得已上路。..... 在路上,只为温暖我的人。-<在路上〉歌词
  • 新域名同时启用,可以使用www.dotNETTools.cn 访问本站
  • 垃圾信息太多,暂时关闭Trackback功能,留言请先登录。
  • 建议使用IE6,IE7,Avant Browser,Maxthon, 1024x768 以上分辨率浏览
  • 请在页面的左/右侧Skins下面选择喜欢的皮肤,有10种以上的皮肤供你选择
  • 可以选择Tags页面,可按分类或关键字方式查看
  • .NET评测网出现页面空白的情况,请在IE将编码方式选择为自动或UTF-8,论坛的编码近日修改为UTF-8

-- 2007-11-14 13:27:28 
View Mode: Normal | Article List
January, 2006 | 1

Locked Juval Lowy-编码规范-编码实践篇

[ 2006-01-11 01:00:43 | Author: ccBoy ]
Coding Practices
  • 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.

  • 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.

  • 8. Avoid
...

Read More...

Locked Juval Lowy-编码规范-代码命名篇

[ 2006-01-11 00:13:42 | Author: ccBoy ]
Naming Conventions and Styles
  • 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...
    1