Roll Your Own

Kevin Ennis
2 min readNov 21, 2017

--

“How do I get better at JavaScript?”

It’s a question I get asked pretty often.

For the past few years, my answer has always been: “Roll your own x”, where possible values of x include jQuery, Backbone, Redux, a DNS server, Express, Handlebars, Mocha, a reverse proxy, etc.

I’m not saying anyone needs to make a fully API-compatible jQuery clone, and I’m definitely not saying that you should try to use it in production (although, YOLO). But what I am saying is that building low to medium-fidelity versions of these things will introduce you to the kinds of problems that are much less likely to arise when you’re just building basic web apps. Even better, it takes things that used to be “magic” and makes them boring. In a good way.

At least half the time I’ve given this advice, people say “but I don’t know what to build!”. In an effort to pre-empt that response now, here’s a big list (I’ve done almost all of these in some capacity, so I promise it’s possible):

  • jQuery
  • Backbone
  • Redux
  • A DNS server
  • Express
  • Handlebars
  • A logging library
  • Mocha
  • A reverse proxy
  • A voice recorder
  • Chai (or other assertion libraries)
  • React
  • An IP address parser/formatter
  • ESLint
  • A UUID generator
  • D3
  • Moment
  • A cookie library
  • Lodash/Underscore
  • Bluebird
  • A TOTP/HOTP library
  • A fetch polyfill
  • A random package from one of your node_modules folders

Remember, the point isn’t necessarily to build fully functional, feature-complete versions of all of these. You can usually understand about 80% of the problem space with 20% of the effort. If you find that you’re not learning much anymore on a project, move on to a new one.

If you’re interested in giving one of these a shot and need a bit of help, here’s a hint on how to get started with a simple jQuery clone. The “magic” is basically all in the each method. Almost everything else in jQuery hangs off of that.

Now go build something.

If you’re interested in leveling up your JS skills, live near Boston, and want to build a fundamentally better internet service at Starry, shoot me an email.

Also, follow me on Twitter @kevincennis.

--

--

Kevin Ennis

Director of Engineer and founding team member @StarryInternet. Formerly @Aereo. @kevincennis on Twitter and Github. http://kevvv.in