Live data from Hacker News

Eloquent JavaScript 4th edition (2024)

eloquentjavascript.net

31–40 of 249 posts

Re: Eloquent JavaScript 4th edition (2024)

#31
post #4

This is my favorite book about JS, and I always recommend it to people. It occurs to me for the first time that the lack of TypeScript might be a problem, because if I’m making recommendations to someone learning, I am definitely going to recommend they write TS instead of JS. On the other hand it may actually be helpful to learn the concepts in this book without the additional syntax overhead of type annotations, pl…

[deleted]

Re: Eloquent JavaScript 4th edition (2024)

#32

Serious question - has Javascript the language evolved any features for handling integer math correctly so expressions like 2*57 aren't silently rounded? I realize that in most cases Javascriopt is "good enough" for useful work but I've seen even senior engineers get tripped up by Javascript's corner cases when it comes to its handling of integer vs float.

[deleted]

Re: Eloquent JavaScript 4th edition (2024)

#34

Earlier quoted context omitted.

Because TypeScript is the de facto standard way of writing JavaScript for most of the industry and it has killed all of the other compile-to-js languages. The chances of it going out of favour are very slim, there's a giant ecosystem built on it and the language is very well loved by devs (should be second only to Rust). Microsoft has 50 people on payroll working only on TS. Any competitor needs a gargantuan investme…

And JavaScript has a bigger ecosystem and more entrenchment, not to mention an international standard.

Not sure how's that relevant.

Any valid JavaScript is valid TypeScript and you're gonna write and read TS anyway in the industry.

They aren't in competition, but coming back to the first comment it sounds reasonable to start directly with TS for many users.

Re: Eloquent JavaScript 4th edition (2024)

#35
post #7

Earlier quoted context omitted.

> I am definitely going to recommend they write TS instead of JS Why is that? If you want them to learn JS, teach/recommend them to learn JS? Compile-to-JavaScript languages come and go, but JavaScript has remained. First learning vanilla JavaScript makes sense, and then add TS on top if you really have to. At the very least they'll be prepared for when TypeScript goes out of favor.

Because TypeScript is the de facto standard way of writing JavaScript for most of the industry and it has killed all of the other compile-to-js languages. The chances of it going out of favour are very slim, there's a giant ecosystem built on it and the language is very well loved by devs (should be second only to Rust). Microsoft has 50 people on payroll working only on TS. Any competitor needs a gargantuan investme…

Flow has about a dozen of important features that typescript lacks (while being 10x smaller in terms of LoC).

Re: Eloquent JavaScript 4th edition (2024)

#36
post #7
post #4

This is my favorite book about JS, and I always recommend it to people. It occurs to me for the first time that the lack of TypeScript might be a problem, because if I’m making recommendations to someone learning, I am definitely going to recommend they write TS instead of JS. On the other hand it may actually be helpful to learn the concepts in this book without the additional syntax overhead of type annotations, pl…

> I am definitely going to recommend they write TS instead of JS Why is that? If you want them to learn JS, teach/recommend them to learn JS? Compile-to-JavaScript languages come and go, but JavaScript has remained. First learning vanilla JavaScript makes sense, and then add TS on top if you really have to. At the very least they'll be prepared for when TypeScript goes out of favor.

TypeScript isn't really a "compile-to-JavaScript" language in the same way that, say, Rescript is. Modulo a few corner cases (e.g. enums) which are now considered anti-features, TypeScript has the exact same runtime semantics as JavaScript - you can (almost) convert TypeScript to JavaScript just by stripping away the type annotations (and, if various ECMAScript proposals go through, you won't even need to do even that).

This is both a curse and the secret behind its success - it's arguably not a separate language, but instead an annotation layer on top of the existing language for encoding and checking your static reasoning and assumptions.

Re: Eloquent JavaScript 4th edition (2024)

#37
post #7

Earlier quoted context omitted.

> I am definitely going to recommend they write TS instead of JS Why is that? If you want them to learn JS, teach/recommend them to learn JS? Compile-to-JavaScript languages come and go, but JavaScript has remained. First learning vanilla JavaScript makes sense, and then add TS on top if you really have to. At the very least they'll be prepared for when TypeScript goes out of favor.

Because TypeScript is the de facto standard way of writing JavaScript for most of the industry and it has killed all of the other compile-to-js languages. The chances of it going out of favour are very slim, there's a giant ecosystem built on it and the language is very well loved by devs (should be second only to Rust). Microsoft has 50 people on payroll working only on TS. Any competitor needs a gargantuan investme…

Technically Haxe is still a thing, though its typical use case these days is almost 100% game development (including the JS target).

Re: Eloquent JavaScript 4th edition (2024)

#38
This is, in my opinion, the book to use to learn JavaScript at more than a surface level. The only other materials I recommend as much (but for a different level of learner) are the “You don’t know JavaScript” in-depth book series.

In 2015, I was consulting for a distance learning program, administered by a major California University, that wanted to replace their current textbook (one of those “Head First” O’Reilly books) with something that had a bit more meat but was very approachable. I immediately recommended this and it was fawned over by both the advisors and instructors. It was also the cheapest option they had in the running (even excluding the fact it can be read for free) as it was competing against traditional text books. One year later, students were polled on it and it was met with a lot of positivity as well.

Re: Eloquent JavaScript 4th edition (2024)

#40

Earlier quoted context omitted.

And JavaScript has a bigger ecosystem and more entrenchment, not to mention an international standard.

Not sure how's that relevant. Any valid JavaScript is valid TypeScript and you're gonna write and read TS anyway in the industry. They aren't in competition, but coming back to the first comment it sounds reasonable to start directly with TS for many users.

Your experience is not the industry. JS is widely used, almost certainly more than TS.
Post reply on HN