JavaScript Patterns 2.1 Writing Maintainable Code
2014-05-14 22:11 小郝(Kaibo Hao) 阅读(271) 评论(0) 编辑 收藏 举报Revisiting the code after some time has passed requires:
• Time to relearn and understand the problem
• Time to understand the code that is supposed to solve the problem
As the application matures, many other things happen that require your code to be reviewed, revised, and tweaked. For example:
• Bugs are uncovered.
• New features are added to the application.
• The application needs to work in new environments (for example, new browsers appear on the market).
• The code gets repurposed.
• The code gets completely rewritten from scratch or ported to another architecture or even another language.
Maintainable code means code that:
• Is readable
• Is consistent
• Is predictable
• Looks as if it was written by the same person
• Is documented
出处:http://www.cnblogs.com/haokaibo/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。