Locating Bugs in Your Javascript Code

If you’re anything like me, you have traditionally used javascript alert boxes to try to identify and diagnose bugs in your javascript code. There are two major issues with this process, though.

  1. It’s extremely inconvenient for your users if you’re trying to debug a live application.
  2. It can be a real problem if you end up in some sort of long/infinite loop and end up outputting multiple alert boxes.

There is a better way, though, and it basically works in Internet Explorer (version 8), Firefox (with the Firebug extension installed), Chrome, Safari and Opera. This is nothing new, by any strecth of the imagination, but it still seems to be a bit of a well-kept secret for a lot of developers.

A Fantastic Resource From Smashing Magazine

Earlier this week, Smashing Magazine put together a fantastic resource for PHP developers. The post is a list of “50 Extremely Useful PHP Tools.” The categories covered in the post are:

  • Debugging Tools
  • Testing and Optimization Tools
  • Documentation Tools
  • Security Tools
  • Image Manipulation and Graphs
  • PHP Code Beautifier
  • Version-Control Systems (though, according to the comments, the tools listed in this section arguably do not belong there)
  • Useful Extensions, Utilities and Classes
  • PHP Online Tools and Resources
  • In-Browser Tools (Firefox Add-Ons)
  • Frameworks for PHP
  • PHP IDEs and Editors
  • Sources and Resources

The descriptions of some of the tools in the article could have been a little better, as I don’t even understand what some of the tools are designed to do. However, there are quite a few interesting items in the list. I will definitely be trying some of them over the next few months to see how they work and what they might be able to do for me.