代码改变世界

阅读排行榜

JavaScript Patterns 4.2 Callback Pattern

2014-06-08 23:37 by 小郝(Kaibo Hao), 294 阅读, 收藏,
摘要: This post introduces the classis callback usage in JavaScript. 阅读全文

Effective C# 学习笔记(十九)确保0(null)对于值(引用)类型是一个合法(理)的默认值

2011-07-09 23:23 by 小郝(Kaibo Hao), 292 阅读, 收藏,
摘要: 确保你的类创建对象时的默认值是合法且合理是非常重要的,不论对于值类型还是引用类型都是如此。 阅读全文

JavaScript Patterns 2.11 Writing Comments

2014-05-26 13:43 by 小郝(Kaibo Hao), 291 阅读, 收藏,
摘要: Document all functions, their arguments and return values, and also any interesting or unusual algorithm or technique. Think of the comments as hints ... 阅读全文

JavaScript Patterns 2.6 switch Pattern

2014-05-21 22:03 by 小郝(Kaibo Hao), 291 阅读, 收藏,
摘要: This post introduces the principle of the use of switch-pattern. 阅读全文

JavaScript Patterns 3.5 JSON

2014-06-01 16:19 by 小郝(Kaibo Hao), 288 阅读, 收藏,
摘要: The only syntax difference between JSON and the object literal is that property names need to be wrapped in quotes to be valid JSON. In object literals the quotes are required only when the property names are not valid identifiers, for example, they have spaces {"first name": "Dave"}. 阅读全文

JavaScript Patterns 4.3 Returning Functions

2014-06-09 22:54 by 小郝(Kaibo Hao), 286 阅读, 收藏,
摘要: Use closure to store some private data, which is accessible by the returned function but not to the outside code. 阅读全文

JavaScript Patterns 3.1 Object Literal

2014-05-27 12:30 by 小郝(Kaibo Hao), 283 阅读, 收藏,
摘要: Don't use new Object(); use the simpler and reliable object literal instead.This will help you get readable and reliable code. 阅读全文

JavaScript Patterns 5.8 Chaining Pattern

2014-07-03 23:20 by 小郝(Kaibo Hao), 282 阅读, 收藏,
摘要: This post introduces how to implement the Chaining pattern and the pros and cons of this pattern. 阅读全文

JavaScript Patterns 6.7 Borrowing Methods

2014-07-22 11:48 by 小郝(Kaibo Hao), 278 阅读, 收藏,
摘要: You want to use just the methods you like, without inheriting all the other methods that you’ll never need. This is possible with the borrowing methods pattern, which benefits from the function methods call() and apply(). 阅读全文

JavaScript Patterns 2.3 For loops

2014-05-17 10:14 by 小郝(Kaibo Hao), 278 阅读, 收藏,
摘要: Do you know how to write the for-loop efficiently? Read this to get it. :) 阅读全文