learnyounode
learnyounode copied to clipboard
My First I/O: Misleading instructions; clarify "first command-line argument"
I think the instructions for this challenge, as seen here:
are a little misleading. While technically accurate, for beginners this can be confusing as a) no arguments are passed by the user outside of "learnyounode run file.js" and b) the clandestine argument ends up as the third, not first, index in the process.argv array.
+1 Should say "Third element after node and program"
+1
But you don't need to process command line arguments for exercise 1 and in exercise 2 it does clearly explain about the command line arguments.
I agree with @connorwyatt. If you've done exercise 2, you would've learned that the actually CLI parameters start at the third position (index 2 of the process.argv
array). This is actually silently testing that you've learned from the previous exercises and can use that knowledge now.
Just saw another student run into this. Couldn't tell whether it was the previous exercise not managing to teach the knowledge required or that the student simply had forgotten at the time he returned to the exercises.
Right now the error is unhelpful and since we can't test whether the student grabbed the right arg it seems doing something to the docs is the only solution. Maybe a hint on the first argument not being the first element?