The Best Tool I Ever Wrote

Posted

One of the best bits of code I ever wrote was a little JavaScript bookmarklet for my previous job at the Arbor Day Foundation. It swapped out the URL of the live server with the development server (and vice versa).

Before that, we had to manually click the address bar, click again to deselect the text, select the relevant part of the URL, replace it with the desired server address, hit enter, and wait for the page to load. It was tedious and prone to human error, and I just wanted to click a button. Nobody asked me to do it, but I decided to see what I could do to make the process more simple.

I was pretty new to JavaScript at the time, so it took me about an hour and a half to write the if/else statement and figure out how to make it work as a bookmarklet. When I was done, I wondered if it was really worth the time investment, considering the previous manual method took all of five seconds to complete. Nevertheless, I shared it with my co-workers and while they appreciated it, I think they wondered if I had my priorities straight. After all, real work needed to be done on the part of the website that customers actually use.

Soon everyone had it in their bookmark bar, though, and using it just became second nature. Nobody ever really mentioned it, but it did become a part of the setup process any time we had a new hire—part of that process always included sharing my little server switcher. Because of this alone, I’ve never believed that my effort went unappreciated.

Whether or not the time was “worth it” didn’t matter, because it became an essential tool in our everyday process. In that regard, it had value. But let’s dig in for a moment and crunch some numbers.

Assuming I save five seconds every time I pressed the button, I’d have to switch servers about 1,080 times to even out the ninety minutes I spent coding it up. Assuming I switch from the live to the development server three times a day (probably a conservative estimate), that would take 360 days, (about a year and a half-ish, since we wouldn’t count weekends and holidays). But that’s just my usage alone. There were three people on my team at the time, so divide by three to get 120 days, or 24 business weeks, which is about six months in real time. I worked there for that long several times over! And that’s before you factor in the ease training of new teammates and the fact that I could apply what I learned to future JavaScript problems.

No, it’s not a big, impressive bit of object-oriented genius, but it served its purpose, made life better, and got out of the way. Sometimes it can be hard to really quantify, but sometimes it’s enough to just take some time to make life a little bit easier for yourself.

Comments

No comments allowed at this time. Read my commenting policy.

← Older Newer →