James McParlaneJames McParlane今天有一篇文章談到了一些不該在javascript中作的一些行為。
ajaxian有整理了一下,在下面轉述:
1. Don’t use Object.prototype to extend the base ‘Object’.
2. Don’t use ‘Array’ for an Associative Array
3. There are two types of Library ‘Primary’ or ‘Secondary’. James sees Dojo, Prototype, et al becoming “primary” libraries on which other, more specialized libraries, build.
4. Port code that uses ‘Array’ for Associative Arrays. (Use objects and not Arrays for associative array behavior.)
5. Write JavaScript Tools That Warn Of Rule Violations.
不是很明白為什麼,還在看@@
在這裡記錄一下ccc