Hanselminutes #256: JavaScript& jQuery: Moving beyond Alert()
16 Mar 2011Dave Ward ( @encosia ) and I were honored to be guests on Hanselminutes #256: JavaScript & jQuery: Moving beyond Alert() while we were at the MVP Summit in Redmond, WA.
Our conversations revolved around trying to encourage developers to take their JavaScript knowledge to the next level.
Many developers view JavaScript as a necessary evil and possibly a toy language. Part of this tarnished view of JavaScript may have stemmed from the olden days when you had to manually navigate through the various DOM inconsistencies yourself. Thankfully today modern JavaScript libraries (such as jQuery, Dojo, MooTools, YUI, etc) have abstracted away many of those horrible cross-browser inconsistencies in the DOM.
Many developers donβt take the necessary effort to learn JavaScript appropriately. What typically happens is that a developer will try to code JavaScript in the same way they would C#, Java, etcβ¦ In many cases, you can be successful with this approach, however, the more JavaScript you write you will inevitably find yourself uncovering strange bugs.
Lint Tools These are some tools that can help you identify some common problems in your JavaScript
- JSLint.com by Douglas Crockford *Based on the concepts from the JavaScript: The Good Parts book
- JSHint.com by Anton Kovalyov ( @antonkovalyov ) *A JavaScript Community fork of JSLint
Script Loaders A way to load your scripts asynchronously so that your pages can load faster
- LAB.js by Kyle Simpson ( @getify )
- RequireJS by James Burke ( @jrburke )
- DeferJS by Boris Moore
- YepNope by Alex Sexton ( @slexaxton ) and Ralph Holzmann ( @ralphholzmann )
- etc... ( spreadsheet comparing many script loaders )
HTML5 Libraries Detects features of your browser so that you can use it or pollyfill with JavaScript
- Modernizr by Paul Irish ( @paul_irish ), Faruk AteΕ ( @KuraFire ), and Alex Sexton ( @slexaxton ) *Note: The YepNope script loader works really well with this library. Check out Progressively Enhancing HTML5 Forms by Chris Coyier ( @chriscoyier )
- List of HTML5 Cross Browser Pollyfills
Books These are some good books to introduce you to JavaScript, show you what you what parts are good, and also good patterns that you should consider.
- Eloquent JavaScript: A Modern Introduction to Programming by Marijn Haverbeke ( @marijnjh ) *Free
- JavaScript: The Good Parts by Douglas Crockford
- JavaScript Patterns by Stoyan Stefanov
Articles These articles are targeted for C# developers that want to understand JavaScript better.d
- How Good C# Habits can Encourage Bad JavaScript Habits: Part 1 - Global Scope & Declaring Arrays & Objects
- How Good C# Habits can Encourage Bad JavaScript Habits: Part 2 β False-y, Testing and Default Values, Comparisons, and Looping
- How Good C# Habits can Encourage Bad JavaScript Habits: Part 3 β Function Scope, Hoisting, & Closures
- JavaScript for C# Programmers by Julian Bucknall ( @jmbucknall )
Videos These are some great videos that I have learned a lot from. If you have time I strongly encourage you sit back and enjoy.
- Crockford on JavaScript video series on Yahoo!
- 10 Things I Learned from the jQuery Source by Paul Irish ( @paul_irish )
- 11 More Things I Learned from the jQuery Source by Paul Irish ( @paul_irish )