Live data from Hacker News

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

github.com

101–110 of 113 posts

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

#101
post #98

Earlier quoted context omitted.

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.

I think it's undeniable that we spend most of our time by debugging and fixing the existing code structure, bugs, defects and sometimes adding new features. I highly doubt of existence of a book that can teach how to effectively do that. It's a luxury and real pleasure if you are asked to create the project from scratch in a real job.

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

#102

This is great! I am fairly familiar with programming having done both AS, Lingo and PHP I understand code when I see it. I am however not a programmer but more a technically oriented product designer and so I don't get to practice as often. I have been trying to get into javascript and while I understand all the fundamentals it's still not something that I feel comfortable doing which is a shame as it's kind of the l…

Thanks for your nice comment and for these suggestions.

You can support my work by buying the ebook version on Leanpub: https://leanpub.com/thejsway.

Monetization is not my #1 priority right now, but that might change later ;)

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

#103

I just got home from teaching JavaScript to a room full of people who've never written a line of code in their life. This book is missing something critical that most intros to JavaScript overlook: How does the student set up the plumbing and run their code? It's amazing how much of a hump this is for many trying to get started. It also amazes me how oblivious most of us programmers are to it. "Just open Chrome Dev T…

As a teacher myself I know this firsthand and I agree with you.

Unfortunately, text is not a good medium to describe actions. A text-based environment setup tutorial ("double-click on this icon", "create this file in that folder", and so on) is tedious and ultimately inefficient. A screencast is certainly a better solution there. I might create one later.

Coding online with tools like CodePen and Glitch is another quicker and simpler solution for a complete beginner. This option is described in the book appendix.

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

#104
post #76

I just got home from teaching JavaScript to a room full of people who've never written a line of code in their life. This book is missing something critical that most intros to JavaScript overlook: How does the student set up the plumbing and run their code? It's amazing how much of a hump this is for many trying to get started. It also amazes me how oblivious most of us programmers are to it. "Just open Chrome Dev T…

Shouldn't the answer be obvious? Every Python tutorial: type 'python' and enter commands into the REPL. Every Ruby tutorial: type 'ruby' and enter commands into the REPL. Every Exlixir tutorial: type 'iex' and enter commands into the REPL. Every Perl tutorial: type 'perl' and enter commands into the REPL. So for JavaScript: type 'node' and enter commands into the REPL.

Shouldn't the next question be obvious? - "What is a REPL?"

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

#105
post #48

Earlier quoted context omitted.

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.

This is a cool idea. I hope you do this and I happen upon it one day.

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

#106
post #89
post #68

Earlier quoted context omitted.

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.

What I think he means is that if you "use strict" you will get an error if you reference a undeclared variable, but due to the hoisting you will not get an error if you use a variable before it has been declared - if it's declared later in the scope. But if you use let, you will get an error! Such errors are trivial to detect even for beginners though ... Something more nasty is when you have an undeclared (undefined), maybe misspelled object property, then neither "use strict" block scope, or even const will help. It's also hard to find such bugs via static analysis, Typescript nor Eslint will detect it! This is a feature in JavaScript though, and has nothing to do (but often confused) with block scope vs function scope, or loose type vs strict types. In other languages you would need several lines of boilerplate just to do something like "foo.bar=1", and I think the convenience outweigh the possible hard to debug errors, and I'm also working on a static analysis tool that will detect some of those errors.

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

#107
post #82
post #73

Earlier quoted context omitted.

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?

Index of element is greater than minus one is an odd way of thinking about whether an array contains an element.

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

#108
post #81

Earlier quoted context omitted.

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.

Odds are that it is a native module. That's unfortunate, but there is a plan in place to make a consistent native module API: https://github.com/nodejs/abi-stable-node

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

#110

Earlier quoted context omitted.

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.

This is a cool idea. I hope you do this and I happen upon it one day.

I probably should just start an "as yet unimplemented ideas" section in my blog.
Post reply on HN