Cracking the Code WHAT WORKS WHEN TEACHING STUDENTS TO CODE?
Correction: Firstly, this is more than just code. Coders can write code Programmers understand the underlying concepts. They understand the process and concepts of logic which – when implemented via code – bring digital services to life. This is what we want our students to do.
Rationale Computing is now a foundation subject in the UK and all students must be offered a course which offers them the opportunity “to study aspects of information technology and computer science at sufficient depth to allow them to progress to higher levels of study or to a professional career.”
Programming Experiment Fail Learn Repeat
MSW Logo
Why? Why Logo? Peels everything else away You can deliver complex concepts in an easy to digest manner Easy to see the progression Easy for a non-specialist to deliver Free download Why let them fail? Build resilience Learning by discovery Allows them to discover for themselves Empower the students
Broad Aims To get students thinking logically: Step by step Seeing patterns Breaking down problems into smaller parts (Decomposition) To demonstrate why it is useful to write more efficient code. To show that writing code can be fun, frustrating and rewarding!
Logo Unit Overview: Lesson 1: Write code line by line Lesson 2: Use repeats to write more efficient code Lesson 3: Create subroutines Combine subroutines to create shapes Lesson 4: Create a cityscape – breaking down a problem into its component parts Lesson 5: Assessment
Today: Today I am going to deliver a condensed version of what I teach to the students. Usually I would ensure you have time to play and experiment!
Skill 1 WRITING SIMPLE CODE
How many degrees are in these angles? Math Lesson 90˚ 270˚
What do all 3 internal angles in a triangle add up to? Why do we need to know the external angles? Math Lesson: External Angles 60°120°
Figuring out internal angles of a polygon. (no of sides – 2) * 180 E.g.: (5-2) * 180 = 540 (4-2) * 180 = 360 Polygons External Angle: 72° External Angle: 90°
Task Calculating the Angles in polygons: Have a go at calculating some of the angles.
Think: You can use the following code: FD BK RT LT FD 100 BK 20 RT 90 LT 120 What do you think these instructions might do? Examples of how the code can be used:
Logo Example
Writing Your First Code Task: Using the worksheet complete the code for as many shapes as you can. You can use the following commands: FD BK RT LT Remember: Your turtle always starts pointing North.
Pattern Recognition Instructions for a square: fd 100 rt 90 Wouldn’t it be useful if we could just write that repeated line once? Can you see a pattern?
Task Try writing the step by step instructions for some of the shapes:
Skill 2 USING REPEATS
Repeats Old Way: fd 100 rt 90 New Way Repeat 4[fd 100 rt 90] Can you think of any reasons why the new way might be better?
Task Try writing the efficient instructions for some of the shapes using a repeat:
Skill 3 SUBROUTINES
How did we draw a square of side 100? repeat 4 [fd 100 rt 90] Wouldn’t it be useful if every time we wanted to draw a square we could just write the word square. Good news, we can!! Subroutines
Can you see a repeating shape in this pattern? (Hint: It is repeated 6 times) Get Thinking
Creating Shapes repeat 10 [square rt 36 ] repeat 36 [circle rt 10 ]
Task Try and write efficient code to create the patterns:
What Do Students Say? The got to be creative Understood the concepts – efficiency Liked having time to “play” Thought it was cool – had the “wow” moment!