4 y8 o( o/ e/ d; y8 r, `3. 可继承性。代码重用性,根据新的功能不用修改目前代码或是很少修改吧所需要的功能添加上去。 # T5 D( E, U3 D$ B& g: D D. [# ~& L. y
4. 可测性、可配置性和已修复bug。把所设计的代码根据功能进行,尽量少的bug。项目模块化,根据模块的配置进行项目的组装,成为新的项目。 4 C5 r/ i6 G" G3 f) w" {$ P" G1 J" i" P. n3 u
8 W, j* x M+ ]' } - b* O& v Y6 j R# Q4 b 关于其他方面的说明定义: - r' i! }2 v8 F5 [1 Y2 K( Q) C : T, k1 _ L# v( f k2 v4 t 'Good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards' that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' code analysis tools, etc. can be used to check for problems and enforce standards. 2 j( _: g+ [ R1 [ : X; t1 n" B$ l' L 另外,来自 MSDN END BRACKET 栏目的作者 Paul DiLascia ,也列出了优秀代码应有的物质:不管你用什么语言进行开发,所有的优秀代码都会展示出共有的经典品质:简练,易于理解,模块化,层次性,设计良好,高效,优雅,并且清晰。 , B0 d# [/ s6 L! {5 m; N--------------------- 7 L+ S0 K; s/ J& J7 w
作者:美丽海洋 9 k' l6 y$ U; H3 R; r; e& ~/ d来源:CSDN L, ~+ F+ r, a8 R: D I, x( ` : b: f, t% a6 Q: B5 Y+ e : m7 Q, l0 S8 x1 v5 V% ^# T# v6 | 0 R* b5 V' z4 X8 @1 Z& G( |2 q9 I" V2 f0 C