Tuesday, 29 March 2011


Completely off-topic, but gorgeous.

Friday, 18 March 2011

No Excuse

I'm active in a couple of places where people go for help with, amongst other things, JavaScript code running in web browsers. Routinely, you'll get questions like this one where the person asking the question is having trouble visualizing what's happening on the client side, and is stabbing in the dark with alert or console.log to try to figure out what's going on. It's like the old days of debugging with printf. I see it over and over again.

Folks, maybe that was reasonable in, oh, 2002 or so, but here in 2011 if you're using a desktop browser there's just no excuse for not using a proper debugger to set breakpoints, walk through code, inspect variables, inspect the structure of the DOM, etc., etc. No excuse at all. None! Pas d'excuse! ¡No excusa! Keine Entschuldigung! Nessuna scusa!

Why not? Because these days, client-side JavaScript debuggers are a dime a dozen, and they're free. Pick your browser:

  • IE8 & IE9: Semi-reasonable debugger and tools built in, or use the free version of VS.Net
  • IE6 & IE7: Use the free version of VS.Net (or the old standalone script debugger)
  • Firefox: Get the excellent, and free, Firebug plug-in
  • Chrome: Has a good debugger and tools built in
  • Safari: Has a good debugger and tools built in (you may have to enable the menu item in the options)
  • Opera: Has a good debugger and tools built in
You get the idea. The next time you're running into a "cannot access property foo of undefined" error, don't guess where it happened, use a debugger to walk through the code and see!

Happy coding debugging!