Live data from Hacker News

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

github.com

51–60 of 113 posts

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

#51
post #48
post #9

Earlier quoted context omitted.

Very true. Or things like "download and install git". Oh wait you're on a mac you need Brew. But you're on windows? You're gonna need X. You're using linux and still don't know? (e.g. Parent installs linux on a computer for their child to learn programming on (e.g. buys them a rpi) ) Lots of "setup" stuff needs to be explained or at least guided through for a from scratch approach, but also needs to be easy to skim a…

Sometimes I fantasize about a platform for tutorials on "how to do X using Y if you know Z" where prerequisites would be linked wiki-style, but disambiguated for the learner. If they are on Windows and use cmd.exe as their shell, command-line examples would be adapted to that, while someone using bash on Linux would get fitting examples as well. If they already know how to do a part, they get just a short summary ins…

A few times I've visualised this as a tech tree like you see in some RPGs and RTS games. I'm not an artist but I'd love to try sketching this out for a few "trees" at some point.

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

#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?

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

#53
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've seen a few comments here suggesting you spend time explaining how to install toolchain etc or version issues.

I agree that having a default VirtualBox VM might be the best way to go so it's a 2 step install and everyone is on the same page regardless of what OS they have. David Swafford at Facebook has been teaching Python to network engineers at NaNog conferences for awhile and does the same .. he hands out a USB stick with everything needed, but I wasn't there so I emailed him and he gave me a dropbox link for everything needed .. e.g. this talk https://www.youtube.com/watch?v=dv328WQlUQg

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

#54
post #45

Didn't know "var" was outdated. Good stuff, thanks!

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

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.

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

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

If OP wrote using ES2015 then it wouldn't be included, async is defined in 2017

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

#56
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 think you have to introduce all the CS stuff more slowly. Did you learn everything you know about programming in less then five minutes ? Then how do you expect a beginner to understand any of it ? Don't get me wrong though. The content is good, but it's too dense. Reading it as a beginner will be painfully slow and boring, like reading the TCP/IP spec. just to make a HTTP request.

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

#57
post #21

Earlier quoted context omitted.

> "Just open Chrome Dev Tools" or "put this in a file and run Node" are really strange computer tasks to someone who has never typed and executed code. While not a perfect answer to the issue, I often tend to wonder whether or not we lost something in the transition from traditional microcomputers (Apple IIe, Commodore, TRS-80, etc) to the PC era...? Actually, even in the early PC era, the PC booted to ROM BASIC; thi…

I disagree with the "People began to stop being [creators/hacker]" part - the existing people didn't change, the market OPENED UP to allow people who were not hackers and computer experts to be computer users. This is a good thing; otherwise computers would have remained a niche hobby like ham radio or woodcarving. You're right that the average computer owner is not as savvy about the internals as before, but that's…

Agreed. PCs scaled to billions of users. Programming knowledge scales to a much lower level, I believe there's only millions of programmers or at best tens of millions.

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

#58

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

It's the same language. ES2015 is just syntax "sugar" for doing the same thing, it's mostly opinionated and for convenience. So I suggest both looking at the old style and the new style and write your code in a way that make most sense to you! Then when you join a company, there will be style guides and "linters" to enforce it. But if you have to choose, start with the old style because that's how JavaScript have been looking like for 15 years and a lot of code looks like that. Also I'm not a big fan of "trans-pilers".

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

#59
What all these tutorials omit is the tradeoffs JavaScript and node incur in order to be simple and friendly.

- In JavaScript: no type annotations, numbers are floating point numbers, garbage collected, no multi-threading in the language spec. There are some ways to workaround these limitations, but they're not a part of the language.

- The concurrency model of node, based on libuv event loop. This dictates what node is good for and what is not good for. Short lived tasks = good. Long lived tasks = bad (service degradation + cascading failures bad)

Post reply on HN