简单的代码易于调试
阿债
posted @ 2009年7月22日 00:38
in 未分类
, 1645 阅读
今天看一篇英文博客 [url=http://porteightyeight.com/archives/151-9-PHP-Debugging-Techniques-You-Should-Be-Using.html]9 PHP Debugging Techniques You Should Be Using[/url] ——《你应当会用的九种PHP调试技术》。在最后一条,也提到了简单的代码一般更健壮。对于PHP,写简单代码的方法是:
[quote]Keep Things Simple:
1. [b]Keep an eye on functions that are growing[/b]. You may find that you can split the code into several smaller functions.
2. [b]Functions that are only called in one place may be too specific[/b]. You can either bring the ...