代码改变世界

阅读排行榜

NHibernate Notes2_Handling versioning and concurrency

2011-09-04 22:47 by 小郝(Kaibo Hao), 331 阅读, 收藏,
摘要: This notes talks about the optmistic and pessmistic locking to hande versioning and cucurrency in NHibernate. 阅读全文

JavaScript Patterns 4.7 Init-Time Branching

2014-06-15 23:41 by 小郝(Kaibo Hao), 330 阅读, 收藏,
摘要: When you know that a certain condition will not change throughout the life of the program, it makes sense to test the condition only once. Browser sniffing (or feature detection) is a typical example. 阅读全文

JavaScript Patterns 6.4 Prototypal Inheritance

2014-07-18 23:42 by 小郝(Kaibo Hao), 329 阅读, 收藏,
摘要: Use an empty temporary constructor function F(). Set the prototype of F() to be the parent object. Return a new instance of the temporary constructor. 阅读全文

JavaScript Patterns 2.12 Writing API Docs

2014-05-26 13:57 by 小郝(Kaibo Hao), 328 阅读, 收藏,
摘要: Process of generating API documentation • Writing specially formatted code blocks • Running a tool to parse the code and the comments • Publishing the results of the tool, which are most often HTML pages 阅读全文

JavaScript Patterns 2.9 Coding Conventions

2014-05-24 23:07 by 小郝(Kaibo Hao), 325 阅读, 收藏,
摘要: It’s important to establish and follow coding conventions—they make your code consistent, predictable, and much easier to read and understand. A new developer joining the team can read through the conventions and be productive much sooner, understanding the code written by any other team member. 阅读全文

Effective C# 学习笔记(二十二)多用接口定义实现,少用继承

2011-07-13 16:08 by 小郝(Kaibo Hao), 325 阅读, 收藏,
摘要: 首先从宏观上区分接口和类型 1. 接口定义了行为 2. 类型定义特性及继承结构,即是实体间的关系 接口和抽象类的区分 1. 接口和抽象类都可定义行为而不实现 ,但抽象类可以实现也可不实现 2. 接口可以被多继承(实现),抽象类只可被继承一个 阅读全文

JavaScript Patterns 1 Introduction

2014-05-13 08:00 by 小郝(Kaibo Hao), 320 阅读, 收藏,
摘要: Introduction of the JavaScript patterns such as Object-Oriented, No Classes, Prototypes, Environment. And some others related standard and tools such as ECMAScript 5, JSLint and fire bug . 阅读全文

JavaScript Patterns 3.3 Patterns for Enforcing new

2014-05-29 13:24 by 小郝(Kaibo Hao), 319 阅读, 收藏,
摘要: When your constructor has something like this.member and you invoke the constructor without new, you’re actually creating a new property of the global object called member and accessible through window.member or simply member.This post introduces how to enforce "new an object" with the constructor even if there is no new in front of the constructor. 阅读全文

JavaScript Patterns 3.7 Primitive Wrappers

2014-06-03 09:16 by 小郝(Kaibo Hao), 317 阅读, 收藏,
摘要: One reason to use the wrapper objects is when you want to augment the value and persist state. Because primitives are not objects, they cannot be augmented with properties. 阅读全文

Effective C# 学习笔记(十四) 尽量减少重复性的初始化逻辑

2011-07-05 22:55 by 小郝(Kaibo Hao), 317 阅读, 收藏,
摘要: 由于运行效率和代码可维护性问题,应尽量避免使用构造函数的复合调用,C#4.0可以使用参数默认值语法解决,之前的版本用this或base调用构造函数重载 阅读全文