Monday, September 17th, 2007
Douglas Crockford micro-blogged it best:
I have been at Yahoo for two years. One of the first things I did when I got there was to do a
He explains through example, the following:
- Avoid archaic constructions.
- Always use blocks in structured statements.
- Avoid assignment expressions.
- Use object augmentation.
- Use common libraries.
- Watch out for type coercion when using ==.
- Use the ?: operator to select one of two values.
- Never use implicit global variables.
- Do not use the ?: operator to select one of two actions.
- Use the || operator to specify a default value.
- Global variables are evil.
- Use inner functions to avoid global variables.
What’s your style?
Posted by Dion Almaer at 7:54 am