Coding Strategies - Worked examples
Commonly used in a range of subjects, including Maths and Science, worked examples are a form of ‘scaffolding’ designed to help reduce cognitive load placed on novice learners.
When a learner is given a partial (or near complete) solution to a problem, they do not have to rely so much on their long-term memory. Worked examples aim to reduce the superfluous cognitive load, often placed on a learner’s working memory when faced with new challenges, by providing a model solution to a problem.
How it works:
When a learner is given a partial (or near complete) solution to a problem, they do not have to rely so much on their long-term memory. Worked examples aim to reduce the superfluous cognitive load, often placed on a learner’s working memory when faced with new challenges, by providing a model solution to a problem.
How it works:
- Prepare a partial solution to a problem for the students to complete.
- Provide a brief description of what the code is meant to do, this can be in the form of comments or verbal explanation.
- Use sub-goal labelling to identify each of the important steps in the code.
- Add questions / prompts with the aid of comments or annotations.
Worked example (Python)
As learners become more proficient, the benefits of using worked examples are reduced to the point at which they may start to become a hindrance rather than a help! As with any types of scaffolding and support, worked examples should be faded to provide stretch and challenge.
Faded examples
Imagine a faded example as a sort of fill-in the-blank challenge, but with code.
Start by giving students a near complete solution to a problem and challenge them to fill in the blanks. Over time, add more and more blanks until the student is essentially writing the solution for themselves. The following demonstrates a greatly simplified example of a fading using the Turtle library in Python.
Faded examples
Imagine a faded example as a sort of fill-in the-blank challenge, but with code.
Start by giving students a near complete solution to a problem and challenge them to fill in the blanks. Over time, add more and more blanks until the student is essentially writing the solution for themselves. The following demonstrates a greatly simplified example of a fading using the Turtle library in Python.
|
Example 1
(First phase of fading) #Import the turtle library import turtle #Create a new window window = turtle.Screen() #Create a new turtle called timmy timmy = turtle.Turtle() #Create a square with each side #equalling 100 pixels in length for loopCounter in range( ): #What value goes here? timmy.forward( ) #what value goes here? timmy.right(90) |
|
Example 2
(Final phase of fading) #Import the turtle library #Place missing code here #Create a new window #Place missing code here #Create a new turtle called timmy #Place missing code here #Create an equilateral triangle with each side #equalling 100 pixels in length for numberOfSides in range( ): #What value goes here? #Place missing code here |