首页 > 网站 > WEB开发 > 正文

JavaScript Patterns 2.1 Writing Maintainable Code

2024-04-27 14:24:05
字体:
来源:转载
供稿:网友

javaScript Patterns 2.1 Writing Maintainable Code

2014-05-14 22:11 by 小郝(Kaibo Hao), ... 阅读, ... 评论, 收藏, 编辑

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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表