adequately good

decent programming advice

written by ben cherry




Replacing `setTimeout` Globally

Sometimes, you might want to overwrite built-in global methods like setTimeout and setInterval. If you try, you might find that it’s much harder than you think to accomplish this in every browser, particularly if you ever want to find the originals again. After a lot of painful exp...

Thoughts on the Hashbang

There’s been a lot of discussion this week about the “hashbang”, that ugly little bit you find in the middle of URLs like this one: http://twitter.com/#!/ded/status/18308450276. I wanted to provide a rebuttal to the arguments that the hashbang is bad for the Web, based on a lot of discussions we’ve been having inside Twitter since the #newtwitter project began last summer, and have continued...

Saner HTML5 History Management

Hashchange

This event is quite simple. Whenever the window.location.hash property changes, by following a link, setting the property, editing the URL bar, or ...

Writing Testable JavaScript

The engineering culture at Twitter requires tests. Lots of tests. I haven’t had formal experience with JavaScript testing before Twitter, so I’ve been learning a lot as I go. In particular, a number of patterns I used to use, write about, and encourage have turned out to be b...

go next