noamross / zero-dependency-problems

Real-world code problems in R, without dependencies
79 stars 25 forks source link

Forgetting to close paren, quote, etc. #1

Open jhollist opened 9 years ago

jhollist commented 9 years ago

@noamross Nice idea on this repo.

This one is very basic, but accounts for about 40% of the questions I get in the early lessons. It is especially problematic for new learners with little experience on the command line. Students would routinely try to work through examples and not notice that change in the prompt.

Not really R per se, but common enough and one that can discourage people pretty quickly.

noamross commented 9 years ago

This is an interesting one. It seems like it would be incredibly tough to ask someone to "solve," but it would make sense to teach this error early in any lesson. So it might be important to put at the beginning of the R/shell/python lesson to teach explicitly, and repeat.

If I create a debugging/problem solving reference/cheatsheet, the first section might be "common syntax errors," and this would be one of the first entries. It could also include common errrors (and error output), such as extra parens/quotes, non-quoted strings, variable misspellings (and miscapitalization), etc. There might be a reasonable number of common error messages to show here.

jhollist commented 9 years ago

Agreed. I think an early focus on syntax errors would be good. Focusing on syntax is kinda boring, but it is the one thing that causes people to give up quickly. If you can minimize the problems associated with syntax, that might keep them engaged long enough to get to the good stuff!

And having a resource to fall back on when they get something like "object 'x' not found" when they forget to quote a string would be good.

A related discussion from the old SWC bc repo is here https://github.com/swcarpentry/bc/pull/461

There was talk of having a similar type of lesson for R. Don't know if anything came of it.

noamross commented 9 years ago

Note for later: Here's the latest Python version: https://github.com/swcarpentry/python-novice-inflammation/blob/gh-pages/09-errors.md