How I improved tenfold as a JS developer

The reason for me starting JS was out of plain curiosity to play with the DOM. You might all know how learning goes these days—I started and completed the CodeAcademy course, read a few blog posts—and thought that I was great at JS.

I couldn’t be more wrong.

My journey as a JS developer had just started—I just wanted to manipulate the DOM with JavaScript, and I perhaps I wrote ugly code, caring only about the final outcome.

Here are what changes I made to drastically improve how I write JS, and how others read my code.

Started using jQuery

Seriously, with the current state of web, there’s quite no good reason why you shouldn’t use jQuery. Previously I used polyfills and the sort in vanilla JS code to ensure compatibility, but why spend time reinventing the wheel?

I distinctly remember that the last few slides of an amazing presentation by Chris Coyier changed my mind, and I started using jQuery.

I still remember the (poor) ‘vanilla JS’ tutorials I wrote—Those weren’t backward compatible, and the code was, frankly, ugly.

Read a few great books

I finally got around finishing ‘Javascript: The Definitive Guide’ by O’Reily Media. What parts didn’t make sense back then, made a lot of sense now. I also read (a bit of) ‘Eloquent Javascript’, which went a bit in depth with it’s explanation.

I believe that reading the two books, and seeing the way the experts wrote JS, opened my eyes and made me think—“Wow, Namanyay, you write shit code. These guys are so better!” and made me want to improve.

Learnt a few JavaScript design patterns

The free e-book ‘Learning JavaScript Design Patterns’ by the amazing Addy Osmani helped here. Again, I saw more of how others wrote JS, and made changes and fixes to my own style of writing.

From this book, I learnt the revealing module pattern, a pattern which I now love and use extensively in JS. I believe this is the single most important change that improved the quality of my JS.

Being humble

…And I learnt all of this only because I admitted to myself that I had been writing poor code, that I could improve. If I hadn’t understood that, I would’ve remained the amazing JS programmer I thought I was.

Now, I’m admitting my mistakes, and learning even more.
That’s why we all are here for, correct?

I'm on Twitter and Dribbble.

Discuss on Twitter