Live data from Hacker News

Ask HN: How do I learn JavaScript?

news.ycombinator.com

11–20 of 128 posts

Re: Ask HN: How do I learn JavaScript?

#11
Aside from "this", all failure modes in Javascript are pretty obvious to google and figure out (unlike a segfault in C++), so I'd suggest just diving in and implementing something in it, if you already have programming experience.

However, just being able to do something in a language and being able to do it the most correct and future-proof way is different, and in JS, "best practices" seem to be constantly evolving with language and community. Every library and framework seem to be doing things in a slightly different way, and there's a lot of freedom to experiment with different coding styles and programming paradigms (unlike in a language like Go). Personally, I would suggest Typescript for professional projects, but there are plenty of very knowledgegble and competent people with a lot of different opinions on it. If you're the kind of person who likes this kind of environment, you'll fall in love with JS ecosystem.

Re: Ask HN: How do I learn JavaScript?

#12
Assuming you’re fluent in programming and languages in general.

I just went to the console and tried all things that should and should not have work. There you’ll learn about the specifics of prototyping, properties, operators, everything, and get insights for what’s going on under the hood. Didn’t find these details anywhere else. All sources of information are situational, down-to-earth utilitarian and resemble grandma’s cooking recipes, while what you seem to want is precise chemistry. (ed: another problem with js is that most books on it are out of date by design, e.g. one of the suggested links around says that prototypes can only hold methods and not values; what else is wrong there?)

>no browser APIs

A big part of js internals lies in the Object namespace. See also Symbol. (MDN for both)

Re: Ask HN: How do I learn JavaScript?

#13
I liked "JavaScript for impatient programmers" (https://exploringjs.com/impatient-js/) which is a relatively short but reasonably comprehensive explanation of modern JavaScript. In particular, it accurately describes a lot of important details (like how integer keys in objects work, "holes" in arrays, etc).

It doesn't cover the complete language, in particular it doesn't cover all outdated concepts and backward-compatible features. To get a complete understanding you would have to read the JavaScript specifications, but I don't think it makes sense to start there without having a solid understanding of the basic concepts first.

Re: Ask HN: How do I learn JavaScript?

#15
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 getting overwhelmed? Obviously you learn the APIs by building stuff, which I do. I can and do write frontend code, but always with the feeling that I've never learned this stuff properly.

I know there are tutorials aplenty on this stuff -- other than MDN, is there anything authoritative, comprehensive, and deep? Like, the SICP or TAOP of frontend programming?

Re: Ask HN: How do I learn JavaScript?

#16
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...

Re: Ask HN: How do I learn JavaScript?

#17
Find whatever works for you to reach "mediocre proficiency" then use that to improve until you reach "perfect and complete level". You won't find any resource for any language that will hold your hand all the way, if only because the concept of "perfect and complete" is rather fuzzy and subjective (and probably a moving target for a language like JS that's still in active development).

JS is a rather forgiving language (maybe too forgiving) that's very suitable for learning by trial and error. Get the basics, start hacking, find what works and what doesn't, look at other people's code to draw inspiration etc...

Re: Ask HN: How do I learn JavaScript?

#19
post #3

Take a look here, for me this is "the" reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...

Whatever resource you start from this is ultimately what I go to every day at work for answers on anything JS related. Bookmark this link.

Re: Ask HN: How do I learn JavaScript?

#20
A little side note; You could consider ClojureScript.

I've worked with JavaScript many times through the years, and never felt that I got close to becoming an expert no matter what. The language it self is in the way. Browser compatibility, language weirdness (like the =, == or === mess) and there are a lot of standards around. But now a days working with ClojureScript, which settles the language problems, I get to focus on getting good at libraries, react and browser-stuff.

I hope I never have to work with vanilla JavaScript again, but since ClojureScript is a niche I'm pretty sure this dream will burst at some point. But I can attest ClojureScript has brought significantly more enjoyment into my life when dealing with front-end development.

Post reply on HN