New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used GitHub to make suggested changes - Instructor Checkout. #588

Open
carol-rowe666 opened this Issue Jun 24, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@carol-rowe666

carol-rowe666 commented Jun 24, 2017

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.

For example:

ls -F Desktop

ls is the command
-F is the option or flag
Desktop is the argument or parameter

@jttkim

This comment has been minimized.

Contributor

jttkim commented Jun 25, 2017

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.

So, in ls -F Desktop, -F is indeed a flag (because it does not take a parameter), and Desktop is a free parameter (notice it's nothing to do with the -F option). ls doesn't have any commonly used parameterised options, but other commands have, e.g. tar is typically used with -f (parameter is the tar file), and sort is used with -k (parameter is the field number of the sort key) and sometimes also -t (parameter is the field separator).

@carol-rowe666

This comment has been minimized.

carol-rowe666 commented Jun 26, 2017

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".

@shwina

This comment has been minimized.

Member

shwina commented Jun 26, 2017

I agree that the @jttkim provides a very concise and accurate explanation for these terms. But I also propose that first-time shell users may find such details distracting and/or confusing. I think #587 is reasonable, although I am aware that it is not strictly accurate.

@jttkim, thoughts?

@carol-rowe666

This comment has been minimized.

carol-rowe666 commented Jun 27, 2017

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?

@jttkim

This comment has been minimized.

Contributor

jttkim commented Jun 27, 2017

After reviewing 02-filedir.md more closely I think @carol-rowe666's suggestion to

set the record straight instead of saying these mean different things, but are often used wrongly...

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment