learnyounode icon indicating copy to clipboard operation
learnyounode copied to clipboard

Juggling Async Instructions Unclear, Hardcoded Solution, Lack of Semicolons

Open merlinstardust opened this issue 8 years ago • 2 comments

Instructions Unclear I just spent a while, and was finally successful, trying to figure out how to do this without an external library. After seeing your solution and rereading the instructions, I now realize that you were saying you shouldn't use any external libraries to handle the asynchronous aspect. Initially it reads as if you're saying you shouldn't use any external libraries at all. It'd be great if the instructions were clearer on this.

Hardcoded Solution Also, why is it that the solution is hardcoded to just 3 URLs. Wouldn't it be better to do something use process.argv.length - 2 so the solution will work any number of URLs? (Or even better var urls = process.argv.slice(2); to keep things clean and readable)

Lack of Semicolons Why are there no semicolons in the solutions? While I know that it is entirely possible to write JS without semicolons, I feel like it is bad practice for people who are just learning this.

merlinstardust avatar Dec 06 '15 00:12 merlinstardust

I was a little thrown off by the hardcoded length of urls too. I ended up just passing the urls in an array, but it's just an exercise so it's overkill.

mikebelanger avatar Jan 03 '16 20:01 mikebelanger

I think the semicolons debate is a bit of a can of worms.

The npm coding style guidelines say don't use them. But Google's JavaScript Style Guide and the source code of the node builtin modules both suggest you should.

jmalk avatar Feb 14 '16 13:02 jmalk