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

Share this article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Twitter
  • GatorPeeps
  • Digg
  • Reddit
  • muti.co.za
  • DZone
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Ma.gnolia
  • Slashdot

Related posts:

  1. Warn visitors to upgrade from Internet Explorer 6 (IE6) with a simple JavaScript
  2. Minify JavaScript code to obfuscate details and decrease load times
  3. 12 Tips to improve your jQuery code
  4. 10 Cost-Effective web development tips by Drew McLellan
  5. Google’s Page Speed Firefox plugin