I don’t know JS

Three years ago I wrote my first line of JavaScript. One year ago I started as a front end engineer at Twitter. In that time, I haven’t read a single JavaScript book from start to finish — or any coding book, for that matter.

So far I’ve learnt to code through bootcamps, workshops, study groups, online videos, podcasts, meet-ups, mentors, teammates, Stack Overflow… the list goes on. It includes just about every learning resource out there, except for books.

It’s not like I haven’t tried reading them. I bought JavaScript The Good Parts, Eloquent JavaScript and Functional JavaScript back in 2015. I got a couple of chapters into the first and have never opened the latter two.

I recently had dinner with a girlfriend who is a back end engineer at Deliveroo. On her bookshelf sat a big, fat book about Java. I asked her if she’d read it and she said yes. “The entire book?” I gasped. “Every page,” she said. I felt a pang of guilt. So that’s how you go deep on a language, I thought to myself.

More recently I was playing ping pong with one of the senior back enders on my team. I had just discovered I’d shipped a bug to production. One cause of the bug was that I’d forgotten to unsubscribe from an event. It made me realise that I have a shallow understanding of how events work in JavaScript. I was feeling pretty down on myself. “My JavaScript knowledge is too high level,” I complained to her. “I want to go really deep on it.” She told me that the language she knew best was Perl. She told me she’d read two books on Perl. “After that, I felt confident — I knew Perl inside out,” she said. “In fact, I knew it better than anyone in the office,” she joked. But seriously, “you have to read some books,” she said. “It will really help.”

OK girl, I thought. It’s time to get your sh*t together. If you want to feel like you know JavaScript, then you need to take the time to get to know it. JavaScript isn’t going to teach itself to you.

So I asked my Twitter followers for the latest and greatest resources:

Then I put everyone’s suggestions into a Gist:

The one that stood out to me was You Don’t Know JS, a six-book series by Kyle Simpson.

In the preface, it says:

Here, we address head on the tendency of JS developers to learn “just enough” to get by, without ever forcing themselves to learn exactly how and why the language behaves the way it does…
I am not content, nor should you be, at stopping once something just works, and not really knowing why. I gently challenge you to journey down that bumpy “road less traveled” and embrace all that JavaScript is and can do. With that knowledge, no technique, no framework, no popular buzzword acronym of the week, will be beyond your understanding…
When developers encounter confusion, they usually blame the language instead of their lack of understanding. These books aim to fix that, inspiring a strong appreciation for the language you can now, and should, deeply know.

And so my journey with JavaScript continues.

I’ve made it my goal to read at least two of these books, from start to finish, by the end of September.

I’ll be blogging my learnings from the first book here.

To clarify, it’s not that I wish I’d gone deeper on JavaScript sooner.

I’ve gone through various stages in my learning — all of which have led me to where I am today.

In 2014 I could barely write a line of JavaScript. I could never remember the syntax for a for loop, let-a-lone understand what it was doing. Even jQuery was hard. I tried — unsuccessfully — to build a “simple” accordion.

In 2015 I coded Hangman from scratch. This felt like a huge achievement. I’d now reached a stage where I could hack together a game that worked (despite a few bugs). Later that year I started learning React and React Native, and built a series of mini projects with them.

In 2016 I took a job as teacher’s assistant for a JavaScript course at General Assembly. I still wasn’t comfortable with things like scope and closures, event bubbling, promises or ES6 — but many of the students were absolute beginners, and it turned out there was a lot that I could help them with.

Now it’s 2017. I’m in my first front end engineering job. I understand the ES6 arrow function, maps and filters. I understand .bind(), .call() and .apply(). I understand RxJS observables (sort of). I’ve started learning Redux. I’m getting better at writing unit tests.

I’ve been doing my best with JavaScript — just like everyone else out there — which is why my mentor Andreas’s advice is important:

He makes a good point. It takes time to learn a language. I wouldn’t recommend diving into big, fat textbooks if you’re just starting out with JavaScript.

In the beginning, it’s OK to hack at things until they work, without fully understanding why they work. It’s unrealistic to go too deep too soon. If you do, many of the textbook concepts will feel abstract and unattainable. It’s only when you start working with JavaScript every day — when you’re writing and reviewing code to solve real-world problems — that you’ll gain the mental space for these concepts to click and make sense.

Perhaps when I bought — and failed to read — those books back in 2015 I was wanting too much from JavaScript too soon. At the time I had only just started my first developer job writing C#, .net and SQL. That was difficult enough! But now, almost one year into my first front end gig, I’m ready to try again.

I’ll start with Up & Going, the first book in the You Don’t Know JS series, and I’ll be blogging my learnings here.

Wish me luck!