The following is a presentation of well thought-out JavaScript tips and best practices by Christian Heilmann.
His tips include:
- Make it understandable
- Avoid globals
- Stick to a strict coding style
- Comment as much as needed but not more
- Avoid mixing with other technologies
- Use shortcut notations
- Modularize
- Enhance progressively
- Allow for configuration and translation
- Avoid heavy nesting
- Optimize loops
- Keep DOM access to a minimum
- Don’t yield to browser whims
- Don’t trust any data
- Add functionality with JavaScript, not content
- Build on the shoulders of giants
- Development code is not live code



