« My Biggest Worry About The iPad. | Main | The state of Twitter iPhone Apps. »

The Javascript REPL in WebKit.

While looking around at web developer hints and tips, you'll often read of people's love for Firefox and Firebug as if that's the pinnacle of debugging. Well, they're wrong.

Firebug has always seemed slow, buggy and not exactly easy to navigate. An example of this is that while writing this post, I examined Firebug to check that I wasn't missing something and while Firebug does have some of the features I describe below, they aren't located on the Script tab.

One of my favourite rendering engines, WebKit, has its own set of debugging tools know has as the Inspector. The Inspector has one of my favourite features in any Javascript debugging software, a REPL.

When you have the Inspector open, click the second button in from the bottom left and you'll be given an area to type in. This is the Javascript REPL and one of many things that I love about WebKit.


 As you can see from this example, it also features syntax autocompletion of both javascript APIs and variable names.

This has been especially helpful when coding for Twitterfall. Recently, we've been focusing on reimplementing areas of the code to make it more efficient and have a lower footprint.

Sometimes, you just need to be able to test whether writing a function a specific way will give you the output you want. On these occasions it's so nice to be able to open the Inspector and just start typing.