Live data from Hacker News

Ask HN: How do I learn JavaScript?

news.ycombinator.com

91–100 of 128 posts

Re: Ask HN: How do I learn JavaScript?

#91
post #85
post #22

Earlier quoted context omitted.

I would second this, CLojureScript is the first language that has made front end seem sane to me. Unfortunately your chances of getting a job doing ClojureScript is probably slim to none :(

There was a time when you couldn't get a job with Linux, and you couldn't convince a company to try Linux. So you snuck it in, and in some cases the company never knew (partly because it was so much more reliable than other options that it didn't crash nor reboot). Sneak ClojureScript in. I know of one shop that trained its JavaScript engineers to use ClojureScript in two weeks. Quite frankly, if one is smart enough…

I'm a bit tempted to do something like this.

We have an old creaky app which I'm tempted to rewrite in ClojureScript in my own time and then show them it.

Worst case scenario they say it's great, now can we please rewrite it in JS. Best case scenario I get something in Clojure / CLJS into our system.

Either way I'd probably learn a lot just from the project. And I kinda need a new side project at the minute.

Re: Ask HN: How do I learn JavaScript?

#93
post #66

Earlier quoted context omitted.

And in between callbacks and asyncawait, it had Promises. I still often prefer those over asyncawait.

Async/await is semantically just sugar for promises (though implementations don't necessarily operate that way).

I never wrapped my mind around the Promises API, but I have always async/await is much easier to grasp in any language

Re: Ask HN: How do I learn JavaScript?

#94
Read the ECMA scripts. ESPECIALLY sections 13 and 15. Seriously, even the best textbooks will only give you a superficial understanding relative to the actual standards. Sure there are different JS engines, but they all do roughly the same thing. Master the algorithms in the ECMA standard and you won't even need to read textbooks. You will be able to deduce and derive those concepts yourself.

Understand exactly how JavaScript gets converted under the hood. Remember, ECMA could be implemented in any language not just C/C++. What you're looking for is algorithmic understanding.

For example, here's the snippet that explains how "new" works in JavaScript https://www.ecma-international.org/ecma-262/5.1/#sec-15.2.2..... Going through the algorithm, your first thought may be "wtf is [[Prototype]]"? Dig into it. Understand when, where, and how [[proto]] and __proto__ get assigned. Learn about the cyclic references that allow everything to be an object including functions.

Of course, feel free to use external resources to assist you while reading ECMA since it is quite dry. For the example above, this amazing Stack Overflow post can help you visualize the algorithm: https://stackoverflow.com/questions/650764/how-does-proto-di...

Re: Ask HN: How do I learn JavaScript?

#95
post #66
post #64

Something to keep in mind: Javascript has a lot of obscure language idiom that aren't used in practice. This has to do with how the language was rushed into production, and has gone through quite a lot of revisions. This point is made in the (now very outdated) book "Javascript: The Good Parts," https://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfo... . Crockford, the author, brings you through the best way to…

And in between callbacks and asyncawait, it had Promises. I still often prefer those over asyncawait.

The value is in knowing when to use which.

Re: Ask HN: How do I learn JavaScript?

#96
post #93

Earlier quoted context omitted.

Async/await is semantically just sugar for promises (though implementations don't necessarily operate that way).

I never wrapped my mind around the Promises API, but I have always async/await is much easier to grasp in any language

Maybe because it should have looked like this (personal opinion):

    waitForPromise()
        .then(handleResolve)
        .fail(handleReject)
        .catch(handleException);
But actually looks like this:

    waitForPromise()
        .then(handleResolve, handleReject)
        .catch(handleException);

Re: Ask HN: How do I learn JavaScript?

#97

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…

Not a tutorial or authoritative resource of any kind, but remember you can always open your browser of choice (on the desktop), open the developer tools and start fiddling with the browser APIs interactively, on any page you like.

Re: Ask HN: How do I learn JavaScript?

#98
post #84

Earlier quoted context omitted.

Unfortunately, when one is seeking to learn JavaScript, you will encounter all variations of: + Use Typescript (no, it's not the same as JS) + Use ClojureScript + Use Elm + Use Reason + Use ... If you go back about five years, you'll find this pattern also exists, except all the things people were saying to use are dead. Dead like a forgotten Egyptian pharaoh - buried and never to be seen again. Unfortunately, all th…

JavaScript is still alive not because it's worthy of being alive (compared to the four other languages you mentioned), but because it was first and became well entrenched. COBOL is still alive too... ClojureScript and Reason are superior languages, period. They will live long happy lives, too.

something else will come along that's even more superior, and the tooling surrounding your once-superior codebases will bitrot as the community jumps onto the next passing ship and you're caught holding the bag.

Re: Ask HN: How do I learn JavaScript?

#100
LeetCode, Project Euler, etc. are great if you're looking for a bit of structure with your practice and would give you a reason to go through the MDN docs in a more targeted way. A lot of older resources are more OO-focused, but functional JS is more immediately useful for working with modern front-end libs/frameworks, in my opinion.
Post reply on HN