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

JavaScript Patterns 2.1 Writing Maintainable Code的更多相关文章

  1. JavaScript Patterns 2.12 Writing API Docs

    Free and open source tools for doc generation: the JSDoc Toolkit (http://code.google.com/p/jsdoc-too ...

  2. JavaScript Patterns 2.11 Writing Comments

    Document all functions, their arguments and return values, and also any interesting or unusual algor ...

  3. Practical Go: Real world advice for writing maintainable Go programs

    转自:https://dave.cheney.net/practical-go/presentations/qcon-china.html?from=timeline   1. Guiding pri ...

  4. JavaScript Patterns 7.1 Singleton

    7.1 Singleton The idea of the singleton pattern is to have only one instance of a specific class. Th ...

  5. JavaScript Patterns 5.8 Chaining Pattern

    Chaining Pattern - Call methods on an object one after the other without assigning the return values ...

  6. JavaScript Patterns 5.5 Sandbox Pattern

    Drawbacks of the namespacing pattern • Reliance on a single global variable to be the application’s ...

  7. JavaScript Patterns 5.3 Private Properties and Methods

    All object members are public in JavaScript. var myobj = { myprop : 1, getProp : function() { return ...

  8. JavaScript Patterns 5.2 Declaring Dependencies

    It’s a good idea to declare the modules your code relies on at the top of your function or module. T ...

  9. JavaScript Patterns 5.1 Namespace Pattern

    global namespace object // global object var MYAPP = {}; // constructors MYAPP.Parent = function() { ...

随机推荐

  1. day15-模块的基础及导入

    目录 模块 什么是模块 使用模块 import 循环导入问题 解决方案一 解决方案二 模块的搜索路径 Python文件的两种用途 包 导入包内包 导入包内包的模块 绝对导入与相对导入 绝对导入 相对导 ...

  2. 02Servlet

    Servlet Servlet(Server Applet)是Java Servlet的简称,称为小服务程序或服务连接器,用Java编写的服务器端程序,具有独立于平台和协议的特性,主要功能在于交互式地 ...

  3. TWaver GIS制作穹顶之下的雾霾地图

    “我不满意,我不想等待,我也不再推诿,我要站出来做一点什么.我要做的事,就在此时,就在此刻,就在此地,就在此生”.自离职央视后,沉寂许久的知名记者.主持人柴静昨日携个人视频新作 <穹顶之下> ...

  4. Vue.js 计算属性(computed)

    Vue.js 计算属性(computed) 如果在模板中使用一些复杂的表达式,会让模板显得过于繁重,且后期难以维护.对此,vue.js 提供了计算属性(computed),你可以把这些复杂的表达式写到 ...

  5. 洛谷——P3389 【模板】高斯消元法

    P3389 [模板]高斯消元法 以下内容都可省略,直接转大佬博客%%% 高斯消元总结 只会背板子的蒟蒻,高斯消元是什么,不知道诶,看到大佬们都会了这个水题,蒟蒻只好也来切一切 高斯消元最大用途就是解多 ...

  6. putchar()和getchar()使用解析

    1.putchar() 作用:输出一个字符 格式:putchar(c),c为输出参数 #include <stdio.h> int main() { char a1='A',b1='B'; ...

  7. oracle打开或者关闭flashback

    1.打开flashback: 关闭数据库 SQL>shutdown immediate; 启动到mount方式 SQL>startup mount; 如果归档没有打开,打开归档[因为fla ...

  8. python爬虫30 | scrapy后续,把「糗事百科」的段子爬下来然后存到数据库中

    上回我们说到 python爬虫29 | 使用scrapy爬取糗事百科的例子,告诉你它有多厉害! WOW!! scrapy awesome!! 怎么会有这么牛逼的框架 wow!! awesome!! 用 ...

  9. 恶补数论(二) Baby-Step-Giant-Step 大步小步求离散模对数

    知识概述 好吧,我承认这是我初三寒假就听过的知识,然而我现在早就高一了(又是寒假,只不过我已经在省选了...) 额,这是求离散模对数的一种算法 也就是求满足方程a^x≡b(mod p)的最小的x(其中 ...

  10. go 语言学习指南(一)

    参考资料: http://www.runoob.com/go/go-tutorial.html