Live data from Hacker News

Ask HN: How do I learn JavaScript?

news.ycombinator.com

51–60 of 128 posts

Re: Ask HN: How do I learn JavaScript?

#51

To piggy back onto this thread: I've written a fair amount of severside JavaScript, read the Eloquent JS book, the You Don't Know JS series (which I heartily recommend to the parent), and feel I have a pretty good handle on the modern language itself. How does one take this knowledge and learn the browser APIs (in particular, best practices around those APIs) plus to navigate the frontend ecosystem in general without…

is there anything authoritative, comprehensive, and deep?

I would recommend the official spec. It won't be an easy read, unless you're already used to reading standardese, but there's nothing more authoritative than that.

Re: Ask HN: How do I learn JavaScript?

#52

Read the You Don't Know JS series [0] - this tackles much of what people with mediocre proficiency overlook. To go beyond that you would probably want to dive deep in to the ECMAScript specs [1] to really master the language. I don't think it will be that hard, just a slog. [0] - https://github.com/getify/You-Dont-Know-JS [1] - https://www.ecma-international.org/publications/standards/Ec...

wow, I've never heard of the first resource but it's amazing so far. There should be a directory for these types of resources (I'm thinking of Why's Poignant Guide for Ruby, which also helped me a lot in the past.)

Re: Ask HN: How do I learn JavaScript?

#53
post #4

My favourite resource that I discovered a few years ago in a similar Ask HN thread: http://eloquentjavascript.net > Where do I go? You don't really need to go anywhere else (especially not into the vortex of looking for the best resource) to learn and be confident with vanilla javascript. > ... and how hard is this actually going to be? Well that depends more on you and your preference for learning materials. I studi…

Eloquent Javascript is indeed a good and quick read!

Re: Ask HN: How do I learn JavaScript?

#54

Read the You Don't Know JS series [0] - this tackles much of what people with mediocre proficiency overlook. To go beyond that you would probably want to dive deep in to the ECMAScript specs [1] to really master the language. I don't think it will be that hard, just a slog. [0] - https://github.com/getify/You-Dont-Know-JS [1] - https://www.ecma-international.org/publications/standards/Ec...

OP, this is the best answer to your question. Lots of other answers on this thread are either ignoring the part where you said you wanted to really master the language and recommending introductory JS materials, or, bizarrely, telling you to learn something else instead. I don’t think you can master a language in one go. It’s not how most people’s brains work. I think you do it in stages. Get yourself a good introduc…

Reading the spec will convey many useful details. If you truly want to master them, though, implement the spec and pass the conformance suite.

If Fabrice Bellard can do it, in C, with no dependencies, you can do it in whatever language you're already comfortable with, using the standard library. It's simply a matter of sustained effort and focus over time.

Re: Ask HN: How do I learn JavaScript?

#55

Read the You Don't Know JS series [0] - this tackles much of what people with mediocre proficiency overlook. To go beyond that you would probably want to dive deep in to the ECMAScript specs [1] to really master the language. I don't think it will be that hard, just a slog. [0] - https://github.com/getify/You-Dont-Know-JS [1] - https://www.ecma-international.org/publications/standards/Ec...

Is there something like You Dont Know but for python? Im a sys eng thats been thrust into Python, I really enjoy the language but Im missing fundamentals

Re: Ask HN: How do I learn JavaScript?

#56

Read the You Don't Know JS series [0] - this tackles much of what people with mediocre proficiency overlook. To go beyond that you would probably want to dive deep in to the ECMAScript specs [1] to really master the language. I don't think it will be that hard, just a slog. [0] - https://github.com/getify/You-Dont-Know-JS [1] - https://www.ecma-international.org/publications/standards/Ec...

Agreed, the You Don't Know JS series is very good for solid fundamentals.

At some point, that knowledge can then be applied by learning more advanced language features such as implementing Proxies, Generators, and template literal functions.

To do so, some here are suggesting you read the language spec. I think Rau schmaer's series "Exploring ES6" [0] (and then ES7/8/9) is a great alternative to the actual spec. In those books he basically goes through the new features of each version of the language and does the deepest dive I've seen, with examples and references to the spec.

[0] - https://exploringjs.com/es6.html

Re: Ask HN: How do I learn JavaScript?

#59
I started learning JavaScript in 2008. Back then the popular validation tool was JSLint whose motto is: JSLint will hurt your feelings. The idea is that under the sloppiness of the language there was a polished gem of rapid expression. I didn't really figure out the language, though, until I started writing personal tools during my second military deployment in 2009.

My recommendation for learning this language is to forget all the books and helpful guides. Just build something. Here is a good reference of the standard methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Of that reference list the most immediately important areas are: Array and String.

My personal recommendation for really embracing this language are to learn and master scope in the language. Don't mess around with class, prototypes, inheritance, new, or this until after you have built at least one tool in the language. Most people coming into this language jump in expecting to program in the style of some former language only to be disappointed that JavaScript is not in fact their former language.

My second personal recommendation is to gain confidence around the expressiveness of functions in this language. Functions are first-class objects, which means they can be used anywhere a primitive type can be used. https://developer.mozilla.org/en-US/docs/Glossary/First-clas...

Perhaps the most important thing to learn for any language is data structures. If you have a solid understanding of data structures you can bend any algorithm to your will.

You mention not learning any APIs, but there are two exceptions you should make in order to better understand the language.

* DOM - If you are learning JavaScript in the browser I recommend learning the DOM. I mean the standard imperative DOM methods from the DOM specification. The DOM is a tree model of nodes where each node knows its place in the tree relative to its peers. By appreciating the nature of those fluid relationships you can do incredible things with little effort that execute incredibly fast. I built a complete GUI in the browser in just over 2 weeks that executes as fast as the OS's GUI because I had an understanding of the DOM. Here is the video demo: http://mailmarkup.org/sharefile/demo1.mp4 and code: https://github.com/prettydiff/share-file-systems

* Nodes fs library - If you are learning JavaScript on the terminal with Node.js I recommend learning Node's fs library methods. The file system is also a tree model comprised of nodes that can be walked very quickly.

After you have built one or more tools in this language you will independently learn to appreciate the conventions in this language that best suit your personal programming styles.

Re: Ask HN: How do I learn JavaScript?

#60

> as supported by the most recent version of V8 Why choose V8 as your target, and not a recent standard that multiple modern browsers support?

Because no engine implements the whole recent standard and does everything in a 100% standard-conformant way. Learning an imaginary language seems impractical. I feel more sympathetic to Mozilla than Google but from the practical point of view, again, choosing the Google version for the reference makes more sense as it has more browser market coverage + Node. I've also made a game in vanilla JS recently (using only the Mozilla website for the language and APIs reference) and it works smooth in Chrome but glitches in Firefox.
Post reply on HN