Live data from Hacker News

Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

github.com

81–90 of 113 posts

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#81

Earlier quoted context omitted.

Nice. Thanks for sharing. Bravo for burrito recipe. I'm convinced I became a programmer in 4th grade. Our creative writing assignment was instructions for making a peanut butter & jelly sandwich. Then our teacher followed our instructions literally. Hilarity ensued. --- I think the Intro's link to the local env setup in the appendix is broken. Anymore, I always check the colophon first, then decide to proceed. I appl…

Re: nodeJS versions, I'd go with something like "Install NodeJS, this book was written with version x.y.z"; I don't think JS will become backwards incompatible in the near future, so as long as the book doesn't contain experimental or unofficial JS features, it should be fine for the next 5-10 years.

Anecdotal I suppose, but I have an app that was written for node 5 and it doesn't work on 6+. I'm sure I could figure out and upgrade it, but it's not too high on the priorities yet thanks to nvm. Oh, and it's not the code, it's one or more of the npm modules.

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#82
post #73
post #2

Hi all, author here. Backstory: I'm a CS engineer/teacher and this book is a side project started in December 2016. You can read a bit more about it here: https://medium.com/@bpesquet/walk-this-javascript-way-e9c45a... . The writing process is now completed and I'm actively looking for feedback to make the book better. Any opinion or advice about content, pricing, or that hastily created Leanpub cover would be greatl…

This is a great idea but ES2017 instead of ES2015 would make it even easier for newcomers. This would allow `await` which is a lot easier for newcomers to follow than callbacks or .then(). Also you really want string.includes() ! Node and all current browsers support ES2017 so you don't really lose anything either.

includes is the same as indexof, what's the big deal in your opinion?

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#83
post #73
post #2

Hi all, author here. Backstory: I'm a CS engineer/teacher and this book is a side project started in December 2016. You can read a bit more about it here: https://medium.com/@bpesquet/walk-this-javascript-way-e9c45a... . The writing process is now completed and I'm actively looking for feedback to make the book better. Any opinion or advice about content, pricing, or that hastily created Leanpub cover would be greatl…

This is a great idea but ES2017 instead of ES2015 would make it even easier for newcomers. This would allow `await` which is a lot easier for newcomers to follow than callbacks or .then(). Also you really want string.includes() ! Node and all current browsers support ES2017 so you don't really lose anything either.

[deleted]

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#85
post #2

Hi all, author here. Backstory: I'm a CS engineer/teacher and this book is a side project started in December 2016. You can read a bit more about it here: https://medium.com/@bpesquet/walk-this-javascript-way-e9c45a... . The writing process is now completed and I'm actively looking for feedback to make the book better. Any opinion or advice about content, pricing, or that hastily created Leanpub cover would be greatl…

I skimmed it and think it looks good for a beginner and really like that it focuses on pure JS. One thing I didn't see (and, again, I admit I skimmed) was how to structure a JS project/application. I know this is targeted at beginners, but even beginners need to see structure.

If I missed all this in my skim, please forgive.

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#86

Earlier quoted context omitted.

The only reason I can think of is if you want hoisting for some reason. For example, if you want to call functions before they are declared. Personally, I don't like that style, but some people do.

let / const are both hoisted though, they're just hoisted to the top of the current block scope instead of function scope.

Sort of, but the effect is very different due to the "temporal dead zone." Attempting to access a variable declared with `let/const` or const before the declaration will throw an error, vs just getting `undefined` for a variable declared with `var`.

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#87

Earlier quoted context omitted.

let / const are both hoisted though, they're just hoisted to the top of the current block scope instead of function scope.

Sort of, but the effect is very different due to the "temporal dead zone." Attempting to access a variable declared with `let/const` or const before the declaration will throw an error, vs just getting `undefined` for a variable declared with `var`.

I'm a bit confused. What does "hoisted" mean in this context if accessing the variable before declaration will throw an error?

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#89
post #68
post #54

Earlier quoted context omitted.

I find function lexical scope more natural for JavaScript which is very function orientated, where you pass functions around and use closures a lot. I also find it a PITA having to declare variables before the block, instead of where they are first used. Ex: if(..) { ... huge block of code .. var foo = 1; } Means I do not have to scroll back and forth to declare and set the variables at different places.

In strict mode JS runtimes will hoist the `var` declaration to the top of the declared scope anyway. So `foo` would be declared at the start of the containing function scope, regardless of where you appear to declare them.

That is not specific to strict mode, in fact. It will always be hoisted.

Re: Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch

#90

I think that the best book ever about JS for everyone, especially for those starting from scratch is https://github.com/getify/You-Dont-Know-JS you simply don't need anything else

Completely agree, YDKJS is a great book for learning the language. In my opinion though, it's not the best book for how to practically use JS in the real world. It would be a great supplement for those looking to learn more about language details with the book the OP posted.
Post reply on HN