Jason Frame (@jaz303) was talking about teaching code at Scotland.js, these are my notes from his talk.
We teach students syntax and expect them to extract problem solving concepts from this - we take these for granted. Not only do we need to understand the concepts we also need to express them perfectly. Don't give up on students quickly: "You're not cut out to be a programmer."
Don't start with the raw theory, look at how we teach natural language.
- Repetition - keep doing things. Repeating assigning variables.
- Comprehension - read and understand. What does this simple code do? Don't even need a computer.
- Creativity - express your own ideas. Builds on repletion and comprehension. Frequently we start at this step :-(
- Contionuos exposure - need to have this as part of the curriculum.
Code is universal glue. Don't need to write big applications, need to understand how it works, create mashups. We don't want an elite class of code literate people.
People get put off by the boiler plate - take that away and let them get on with writing the code. Beginners don't get the idea of scope, syntax highlighting visually shows you what you can access. Don't appreciate the nuances of variable naming, they need the concepts of computation not the triva of style guides, Can slow down execution so it's easy to visualise code.
Teaching code: It's hard, essential, but don't dumb it down - remove main frustrations.