Skip to content
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

Shell script lesson exercise List Unique Species has high cognitive load (and relies too heavily on piping) #958

Open
Denubis opened this issue Apr 15, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@Denubis
Copy link
Contributor

commented Apr 15, 2019

I've just been building my handout for my upcoming SWC lesson and I saw the exercise (https://swcarpentry.github.io/shell-novice/06-script/index.html#list-unique-species)

This exercises relies on topics introduced only in exercises two lessons ago, and introduces quite a lot of cognitive load for "Hey, you can use variables in a script to iterate over filenames"

In my exercises, since I don't have much time to polish, I rewrote it as:

List Unique Species
Leah has several hundred data files, each of which is formatted like this:
2013-11-05,deer,5
2013-11-05,rabbit,22
2013-11-05,raccoon,7
2013-11-06,rabbit,19
2013-11-06,deer,2
2013-11-06,fox,1
2013-11-07,rabbit,18
2013-11-07,bear,1
An example of this type of file is given in data-shell/data/animal-counts/animals.txt.
We can use the commands
 cut -d , -f 2 animals.txt | sort | uniq
to produce the unique species in animals.txt. But remembering this exact series of commands is difficult for some busy scientists. 
 
Write a shell script called species.sh that takes any number of filenames as command-line arguments, and uses a variation of the above command to print a list of the unique species appearing in each of those files separately.

But I'm sure folks can improve it from here, perhaps relying on commands we've demonstrated in a lesson instead of a probably-skipped series of exercises?

@Denubis Denubis changed the title Shell script lesson exercise has high cognitive load (and relies too heavily on piping) Shell script lesson exercise List Unique Species has high cognitive load (and relies too heavily on piping) Apr 15, 2019

@jttkim

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

I'm concerned about the "remembering this exact series of commands" remark, as that may suggest to some readers that memorising commands is a good method to learn computing. If there's a pattern of some learners trying to work by memorising commands, rather than by deducing commands when facing requirements, I'd suggest to considering improving explanations of the principles learners need to deduce the commands ahead of this exercise.

@Denubis

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2019

My intention (as you indicated, poorly communicated) was to differentiate what to do after one has achieved a set of commands doing a thing, and that a shell script is a good way to generalise it. I absolutely agree that the language needs work.

My main concern with this PR is that this lesson requires learners to use and generalise from exercises two chapters prior which may have been skipped -- without any repetition or emphasis in the lesson itself. It probably fulfills requirements more effectively to scaffold the piped commands here (with better language, certainly) than to require people solve that and then apply the for loop.

@gcapes

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

These suggestions sound good to me. The exercise is rather more advanced than required, and scaffolding the exercise would be a nice way to build on previous knowledge.

PR anyone?

@ErinBecker ErinBecker added this to the June 2019 Release milestone May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.