adequately good

decent programming advice

written by ben cherry



all articles filed under tools

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 bad for writing testable code. So I thought it would be worthwhile to share a few of the ...

Finding Improper JavaScript Globals

When I interview web developers, my first JavaScript question is usually the following:

What is the difference, in JavaScript, between x = 1 and var x = 1. Feel free to answer in as much or as little detail as you feel comfortable.

Most people would give an answer about how the var keyword makes something a local variable, omitting it makes it a global variable. While I'd love ...