Join GitHub today
Used GitHub to make suggested changes - Instructor Checkout. #588
The Unix Shell - Navigating Files and Directories
Parameters vs. Arguments
Previously in this lesson, you referred to the -F of the ls command as a flag. Then, in this section you call it either a parameter or an argument. As this lesson continues, you go back to referring to -F as a flag. I think this would be very confusing to beginners.
As I understand it, a flag or option is preceded by a single "-" or double "--" and can be left out. A command or parameter comes after a command and provides information to either the command or one of its options.
ls -F Desktop
ls is the command
According to the getopt(3) man page, all characters preceded by a dash are options, up to the first free parameter. There are options that require an additional parameter / argument, and options that do not have a parameter, and the latter are traditionally called flags. Parameters not associated with options are called free parameters, and the first free parameter demarcates the end of all options.
The explanation from jttkim is the most clear and concise explanation of options and flags I've seen. This should be added to the lesson. Thank you! I would love to see your explanation of parameter vs argument.
In the Unix Shell - Navigating Files and Directories lesson, I would recommend including a description of the four terms: option, flag, parameter, and argument. I think it would be best to set the record straight instead of saying these mean different things, but are often used wrongly...and that Software Carpentry will happily add to the confusion; " so we will too".
Not sure how to best approach this either. I agree that it could be too much detail for first-timers. Should there be a link to a detailed description for those who are interested? But, I also don't like the idea of adding to the confusion of terms. Should we make a point of saying that we will make the effort to use the terms consistently throughout the lessons, and of course, checking that we do so? Hence, we can get the next cohort of future programmers using terms consistently.
Thoughts from anyone?
is excellent -- I very much agree with the preference of using terms consistently, rather than introducing them in a way that may appear unnecessarily unprincipled to some readers. It seems possible to me to rewrite the episode so the terms option, flag, argument (and possibly parameter) are used in a consistent manner would make it more readable -- there's no need to introduce and define these terms in an unnecessarily pompous / scary / off-putting way, although a callout box with a brief explanation is probably useful.
However, this goes way beyond the pull request we're discussing here, so perhaps the best way forward is to adopt #587, and to consider a review of the episode as outlined in the future.
Sorry for causing a possibly inconclusive discussion -- I probably should have checked the context of this change more thoroughly before making my initial comment.