Live data from Hacker News

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

github.com

91–100 of 113 posts

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

#91

Should one learn ES2015 before learning ES5? Is there any value or need to learn ES5 if you're not maintaining an old codebase?

If they are writing in Node, I'd say there's no need to learn ES5 as they should be using a node version with LTS. If they are writing JS in the browser? Then yes, they should learn ES5 as it's quite likely they will be debugging transpiled code at some point.

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

#92

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.

From the MDN docs:

"In ECMAScript 2015, let bindings are not subject to Variable Hoisting, which means that let declarations do not move to the top of the current execution context."

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

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

#93
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…

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…

> Our creative writing assignment was instructions for making a peanut butter & jelly sandwich. Then our teacher followed our instructions literally.

Did something very similar at an IBM day camp where we did the same thing :) I was 12 when I attended. I distinctly remember the epiphany I had after the sandwich lesson.

On one of the other days we did Lego MindStorm stuff. I was randomly assigned to the "software" team. They gave us a little workbook/journal with questions for us to reflect on the daily activities. One of the questions for that day was what we liked best. I wrote something very similar to "programming because that's what I want to do when I grow up" (I had decided that then and there). I am a software developer now and that workbook is one of my prized possessions.

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

#94
post #15
post #11

Earlier quoted context omitted.

I love it, very nice. Clean, modern, concise. Are there plans for translating it in other languages? I'd love to have time to translate it to spanish, but almost no free time..

I'd be willing to help with a Spanish translation as well.

This is a great idea, thanks!

I need to figure out how this could be organized and will get back to you in a few days.

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

#95
post #3

Very, very nice. I briefly went over some chapters and I especially admire the 'no framework' approach you've taken. I believe there's a real need for a book like this, kudos to you for making it happen! What inspired you to create this?

Thanks for your nice comment.

I'm currently writing a blog post about this experience. Expect it soon on https://medium.com/@bpesquet.

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

#96

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.

You can only learn how to practically use the language by...practicing it in the real world. No book can teach you that because the real world is too complex.

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

#97
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…

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…

I used the Peanut Butter and Jelly one in my classes when I taught programming. I also used "tying shoes". Both of those examples came from a class I took on how to teach general subjects. Before you can teach someone, you need to be able to explain it well. Thus, before you can tell a computer to do it, the same applies.

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

#98

Earlier quoted context omitted.

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.

You can only learn how to practically use the language by...practicing it in the real world. No book can teach you that because the real world is too complex.

Disagree.. A book could easily show you some basics for project/directory structure, basic code organization, documentation, simple defaults that can really make life easier for a noob. With that he can get used to it and compare code he has to work, or is reading, with what he has already been taught.

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

#99
post #45

Earlier quoted context omitted.

You can technically still use var if you wish, but I'm not sure of any reasons to do so. When switching to let/const, bear in mind the difference in scope: var is function-scoped: (function () { var x = 1; })(); var x === undefined let/const are block-scoped: if (true) { var x = 1; let y = 1; const z = 1; } x === 1 y === undefined z === undefined

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.

Function declarations work like this

  typeof myFn === 'function'; // true
  function myFn() { }

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

#100
post #52
post #44

Looks great. I love modern JS, and the faster everyone can move on, the better! I didn't see any async/await stuff though, is there a reason for that? I'd imagine it would make some code much easier to follow.

> and the faster everyone can move on, the better! Why? Where does this mindset come from?

Why would you want to use callbacks?

Here's a code example from an npm package I was looking at, vs how I would rewrite it in modern JS:

https://gist.github.com/scf4/8157abd755eb9c232e87dcc342b78b4...

Some of it may be preference but a lot of it is objectively simpler to reason about.

I don't understand why anyone would choose to make things unnecessarily complex.

Post reply on HN