JavaScript Patterns 2.1 Writing Maintainable Code
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的更多相关文章
- 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 ...
- JavaScript Patterns 2.11 Writing Comments
Document all functions, their arguments and return values, and also any interesting or unusual algor ...
- 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 ...
- 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 ...
- JavaScript Patterns 5.8 Chaining Pattern
Chaining Pattern - Call methods on an object one after the other without assigning the return values ...
- JavaScript Patterns 5.5 Sandbox Pattern
Drawbacks of the namespacing pattern • Reliance on a single global variable to be the application’s ...
- JavaScript Patterns 5.3 Private Properties and Methods
All object members are public in JavaScript. var myobj = { myprop : 1, getProp : function() { return ...
- 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 ...
- JavaScript Patterns 5.1 Namespace Pattern
global namespace object // global object var MYAPP = {}; // constructors MYAPP.Parent = function() { ...
随机推荐
- [JSOI2012]玄武密码 题解(AC自动机)
显然是AC自动机对吧 插入单词之后把文章在自动机上跑一遍,到达过的节点打上花火标记 之后检查一下每个单词有几个标记即可 可以把题目中的4个字母映射成abcd方便遍历 一定要记得把文章也映射啊! #in ...
- java项目其他基础配置
创建完maven项目之后. 1.pom.xml文件配置项目相关的架包. 2.src.main.resources下边 创建文件夹:spring以及mapper. 3.src.main.resource ...
- pringboot开启找回Run Dashboard
代码中加入 <option name="configurationTypes"> <set> <option value="SpringBo ...
- nginx+keepalived+tomcat+memcache实现双VIP高可用及Session会话保持
Nginx+Keepalived+Tomcat+Memcached 实现双VIP负载均衡及Session会话保持 IP 信息列表: 名称 IP ...
- 小程序wx:key = “{{*this}}”报错
解决方案:改为 wx:key = "*this"
- STL++?pb_ds平板电视初步探索
什么是pb_ds? 除了众所周知的STL库,c++还自带了ext库(应该可以这么叫吧),其中有用pb_ds命名的名称空间(俗称平板电视).这个名称空间下有四个数据类型结构.这些都是鲜为人知的.经过测试 ...
- Openstack manila的一些命令
(本文是测试环境进行的操作:) 1.查看一些信息: [root@openstackcontroller ~]# manila type-list [root@openstackcontroller ~ ...
- python爬虫27 | 当Python遇到MongoDB的时候,存储av女优的数据变得如此顺滑爽~
上次 我们知道了怎么操作 MySQL 数据库 python爬虫26 | 把数据爬取下来之后就存储到你的MySQL数据库. MySQL 有些年头了 开源又成熟又牛逼 所以现在很多企业都在使用 MySQL ...
- python virtualenv 虚拟环境的应用
为什么要使用python的虚拟环境呢?: 首先我们来说不实用虚拟环境的情况: 在Python应用程序开发的过程中,系统安装的Python3只有一个版本:3.7.所有第三方的包都会被pip3安装到 ...
- java 数组排序并去重
https://www.cnblogs.com/daleyzou/p/9522533.htmlimport java.lang.reflect.Array;import java.util.Array ...