Ask HN: How do I go about truly “understanding” JavaScript, or any language?

2 points by elbigbad ↗ HN
I can do plenty of JS and C programming, but feel like I'm not deeply understanding it. How do I take, say JS, and learn it to the point where it really clicks to the point where I can visualize what's going on under the hood when I write programs?

4 comments

[ 4.2 ms ] story [ 20.1 ms ] thread
I found reading John Resig's Secrets of a Javascript Ninja and reading the jquery source code a great help.

I've just started reading Javascript Design Patterns, so can't give a review on that yet.

Of course, nothing beats actually writing javascript.

What's going under the hood? It depends on how deep u wana look under the hood? Language specification level or specific implementation level like Google v8 etc.
> How do I take, say JS, and learn it to the point where it really clicks to the point where I can visualize what's going on under the hood when I write programs?

Learn how a JS engine works. Any engine will do, although V8 is very discussed on the internet. Here's a few things to get started with:

- How the event loop works (https://www.youtube.com/watch?v=8aGhZQkoFbQ). This show how JS works under the hood, what's part of "JS" and what's extended, how async operations are scheduled on a single thread. After watching this, everything will just "click".

- How objects are represented in V8 (https://thibaultlaurens.github.io/javascript/2013/04/29/how-...). It's v8-specific but nevertheless tells you how objects are represented in memory. Keeping these concepts in mind, you will be able to write efficient code on the get-go.

- ES6 spec (http://www.ecma-international.org/ecma-262/6.0/). Optional reading (if you want to read 500+ pages), but it's a handy reference when in doubt. You can literally slap this thing to a person who doesn't know what they're talking about. Not that you should, but backing evidence is always great.