对象健身操:九诫
October 12th, 2009
- 方法只使用一级缩进。
- 拒绝使用else关键字。
- 封装所有的原生类型和字符串。
- 一行代码只有一个“.”运算符。
- 不要使用缩写。
- 任何类的长度不能超过五十行。
- 任何类中的实例变量不能超过两个。
- 任何包含容器的类不能再包含其他的成员变量。
- 不使用任何Getter/Setter/Property。
阻碍我们写出好代码的,首先是根本不知道代码能写多好。
blog comments powered by Disqus
Transparent Thoughts
阻碍我们写出好代码的,首先是根本不知道代码能写多好。