To Learn JavaScript
JavaScript is an extremely popular tool to write applications of different areas for various businesses. My goal in this article is to give some advice for beginners, who start their journey with this programming language. I open with a small story of myself back to good old days, when leaves were green and the sky was blue. Then I recommend books and sources, which can help to dig into different topics and environments. I don’t advertise any resource, but want to outline the main steps, which a developer may perform to understand deeply the modern JavaScript language and its contexts. And I realize that some samples could be outdated, but you know, when I was young… Just joking, but really, classic never goes out of fashion.
My Story
My way in programming started almost 10 years ago in a very interesting natural language processing project. The role was to tune a neural network with simple grammar rules based on internal XML language. I really enjoyed the tasks I had daily. However, as I had a Computer Science background, I wanted to write “real” programs in a language like C++ or C, which I studied at university. At the same time, I’ve started to play with Web, first solving some tasks with dynamic forms for a tourism company. I wrote some logic in JavaScript to show available calendar dates or filter cities by belonging countries, you can imagine. I did not know anything about the environment I’m working with but intuitively could solve those exercises. What really inspired me, is one special assignment I worked on for some time. I had to program a dynamic table with built-in functions and edit-in-place cells. Like you could edit a number in one column, and the result in the bottom magically changed. A super simplified Excel table with limited and predefined actions in it. In the end, I’ve made a working prototype. The really slow one, especially, in Internet Explorer, which I think, was still on version 6, although 7 and 8 were already in a market. I had to dig into DOM and events, which, most likely, I did not even delegate to parent elements. That was my debut. I can’t say I fell in love, but I fell in FrontEnd.
And my next challenge was to learn JavaScript, and whatever technologies it relates to.
Getting Basics
I started with JavaScript: The Definitive Guide by David Flanagan. That’s a really shiny book, which I still would recommend to any junior developer. The reason is that it’s a full reference to the JavaScript language. You would spend some days to accomplish it, but you’ll know all the basic constructions and key features, like types, closures, prototype inheritance, etc. It will also explain browser APIs — window object, AJAX, DOM Event Model, and so many things that can actually overflow head. But stay strong, that’s just a beginning. With this book in mind, you can continue your journey safely, as it gives you a very strong basement to stand on. And of course, that’s not the only book you can use for this purpose. There are plenty of alternatives, great works by great authors, and I will name just a few of them. Feel free to choose one to begin with:
- JavaScript: The Good Parts by Douglas Crockford
- Speaking JavaScript: An In-Depth Guide for Programmers by Dr. Axel Rauschmayer. That one is free online and contains other interesting resources!
- You Don’t Know JS by Kyle Simpson, book series, also free online.
Become a Ninja
Believe me, when you are done with the first step, you will not feel comfortable in JavaScript, but you will like it more. So, you can go with learning the ninja tricks — Secrets of the JavaScript Ninja by John Resig, Bear Bibeault, Josip Maras. John Resig is a cult person of my generation. He is an author of the jQuery library, which was a light in the dark times of medieval JavaScript. And the book goes deep into concepts and development techniques of the language.
I also recommend a classical patterns book I grew with — Learning JavaScript Design Patterns by Addy Osmani. It covers general design patterns used widely in the language, not only from development but also from a historical point of view. The author is a famous googler, who popularises and participates in many key Web projects nowadays.
The following resources are highly important, although they are not structured, and rather can be treated as a reference to topics you find interesting while exploring JavaScript.
As we were talking about googlers already, I think a next step can be to explore the online Google Developers knowledge base with lots of useful articles, videos, and explanations. That includes Web Components details, Google Chrome developer tools tutorials, optimization strategies, and many more. You can find there icons of the modern Web, like Jake Archibald — Google developer advocate. One of his brilliant works is a browser Event Loop clarification — Tasks, microtasks, queues and schedules.
Also, there are plenty of free Web courses on platforms like Udacity, so, don’t hesitate to watch them as well.
The next mashup I suggest to explore is the Pony Foo newsletter about the Web and the most important news. And, of course, just remember, that Mozilla Developer Network (MDN) Web Docs is a great online reference to most important topics and APIs. Whenever you have a doubt or a question, you might find a really good answer with code examples there.
In parallel with all these books and articles, do not stop coding. And there are great resources to do that — Codewars or HackerRank contain different practice exercises and challenges. However, what I would really recommend doing — is to find a project, might be open source, where you want to contribute and where people will help with code reviews and mentoring. I know this is the hardest part, and, maybe one of the next articles will be about those kinds of projects.
Let’s say you are done with some of these materials, and your mind is blown away. Do you think it worth it? Well, I think it does. You’ll feel free talking about JavaScript, understand the context and now is time to move on 😀…
Frameworks
To modern frameworks and related stuff, of course. On the one hand, that’s easy advice about materials to learn, when you know what you want to explore. My proposal will be to go for official documentation, whatever technology you prefer to start with — React, Vue.js, or Angular. All of them have nice tutorials and docs, prepared especially for developers, so, just follow.
A few technologies that I would like to mention, are related to those frameworks, but also found their separate niche in the landscape. First, it’s Redux — a state management library. Its founder, Dan Abramov made a great tutorial, and it’s free! Then, it’s TypeScript — a typed superset of JavaScript. Most modern tools and projects are written in it, and you will like it, too. For instance, VSCode by Microsoft — by the way, I recommend using this IDE for local development. RxJS — a reactive library for the Observable design pattern. Not an only implementation, but, probably, the most popular, and full in terms of covered operators and functions.
In the end, a few words about my favorite part — Node. Server-side JavaScript still sounds strange for developers of other languages, but it is a very powerful platform. I suggest following official docs, but there are also plenty of interesting materials available. And, of course, don’t forget about npm — or even better, start with it 😁
Finally, we are done here. Maybe, after all that materials you’ll find all the answers for the ironical, but truthful article — How it feels to learn JavaScript in 2016. Anyways, these are just my recommendations based on my experience, and there are so many great books and articles, not covered in this overview. What do you use to learn JavaScript? Would be great to hear in comments. And may the force be with you.