Strategies for teaching programming - Bitly

14 downloads 420 Views 2MB Size Report
Students may not have an accurate mental model of the process/computer. Is the computer ... Read before you write – th
Strategies for teaching programming Sue Sentance King’s College London @suesentance [email protected]

CAS South East Conference 6th July 2017

As you come in… Can you spot the errors in this Python 3 program:

What I hope to cover today…        

Why programming can be difficult What research tells us (briefly) What teachers tell us Pair programming Peer instruction activity Code tracing activity Use-modify-create Predict-explain-modify-create

Why programming can be difficult

? Students may not have an accurate mental model of the process/computer Is the computer doing some kind of magic? The trial and error / fingers crossed approach Syntax errors knock confidence Programs don’t work more often than they do work Multiple skills/understanding of concepts/mechanisms compressed into one line of code Difficulty with thinking algorithmically Working at different levels of abstraction As teachers can we relate to any of these? Threshold concepts and misconceptions

Why programming can be difficult

? Conceptual difficulties

Students may not have an accurate mental model of the process/computer Is the computer doing some kind of magic? The trial and error / fingers crossed approach Syntax errors knock confidence Programs don’t work more often than they do work Multiple skills/understanding of concepts/mechanisms compressed into one line of code Difficulty with thinking algorithmically Working at different levels of abstraction Threshold concepts and misconceptions

Why programming can be difficult

? The process of programming

Students may not have an accurate mental model of the process/computer Is the computer doing some kind of magic? The trial and error / fingers crossed approach Syntax errors knock confidence Programs don’t work more often than they do work Multiple skills/understanding of concepts/mechanisms compressed into one line of code Difficulty with thinking algorithmically Working at different levels of abstraction Threshold concepts and misconceptions

Block-based and frame-based tools offer support

Scratch

Stride Stride

Patch

But what about a blank Idle window? (or equivalent in your favourite text-based language?)

Ever not been sure where to start?

What research tells us about learning programming 1. Read before you write – there is clear evidence that tracing and explaining code helps (Lister, numerous papers) 2. Levels of abstraction - problem at higher-level; syntax at lower-level (Perrenet & Kassenbrod, 2006) 3. Threshold concepts in programming cause difficulties for students (Sanders & McCartney, 2016) 4. Misconceptions abound (research from 1980s to current day – Juha Sorva) 5. Pair programming and peer instruction help – these suggest that dialogue and discussion at a logical level help students (Porter et al, 2012) 6. Growth mindset – popular approach, with some research evidence in Computing (Cutts, 2010)

Pair programming – supporting learning of programming Good for girls Another article by Linda Werner et al suggests it supports engagement by girls/women Use in school Now starting to see evidence from research in school (e.g. Werner, L., & Denning, J. (2009). Pair programming in middle school: What does it look like?. Journal of Research on Technology in Education, 42(1), 29-49.

Pair programming started off in industry. Now there is good evidence that pair programming works in university settings, for example in introductory programming classes

Talking about your program: …the process of expressing a problem verbally helps the programmer to develop their own understanding and can often lead to a solution.(Wray, 2010)

If you only do ONE thing …. try pair programming

Activity : Peer instruction You will need some A, B, C, D cards Look around you because you will be discussing in groups of 3 We will do the activity first then reflect on the process

Peer instruction Well-evidenced pedagogical strategy Combination of: - Flipped learning - Collaborative working - Well-chosen MCQs Process - Step 0: Study topic before session - Step 1: MCQ question presented to class - Step 2: Individually decide on answer - Step 3: All vote - Step 4: Discuss answer as group - Step 5: Group decides on answer - Step 6: All groups vote - Step 7: Discuss as class

For more information see http://peerinstruction4cs.org

Example 1

Example 2 The variables angel and egyptian contain 1.7 and 2.0 respectively, which represent their height. What is written out…? IF angel > egyptian THEN SEND "Egyptian is taller" TO DISPLAY ELSE SEND "Angel is taller" TO DISPLAY END IF

A. B. C. D.

Egyptian is taller Angel is taller Egyptian is taller Angel is taller 14

Example 3 Consider what this code does when metalColour is blue, red, or green… IF metalColour == "blue" THEN SEND "Cold" TO DISPLAY ELSE IF metalColour == "red" THEN SEND "Hot!" TO DISPLAY ELSE SEND "Try again!" TO DISPLAY END IF END IF Which options are true? A. When metalColour is blue, Cold displayed B. When metalColour is red, Hot! displayed C. When metalColour is blue, both Cold AND Try again! displayed D. When metalColour is green, nothing happens

15

Example 4 How many times is Hello written out? SET i TO 0 WHILE i