Textual programming in key stage 3

25
Textual Programming in Key Stage 3 Tim Eaglestone Dorothy Stringer School, Brighton

Transcript of Textual programming in key stage 3

Page 1: Textual programming in key stage 3

Textual Programming in Key Stage 3

Tim EaglestoneDorothy Stringer School, Brighton

Page 2: Textual programming in key stage 3

Our scheme of work

7

8

9

Page 3: Textual programming in key stage 3

What’s being used?

Python

SmallBasic

Java

JavaScript

Ruby

Page 4: Textual programming in key stage 3

Why not others?

What language should you choose?

-What you know/are comfortable with-What support can you get?-Ease of use -Ease of installation

Page 5: Textual programming in key stage 3

Python: IDLE

Page 6: Textual programming in key stage 3

Small Basic

Page 7: Textual programming in key stage 3

Java—Greenfoot

Page 8: Textual programming in key stage 3

JavaScript

Page 9: Textual programming in key stage 3

KidsRuby

Page 10: Textual programming in key stage 3

A progression in codingSTAGE LEARNING TO CODE ACTIVITY

Preoperational(Many students get stuck here)

•Spotting keywords•Identifying numbers and data (variables)•Spotting syntax elements (such as block starts and ends)•Recognising constructs (sequences, loops, conditions)•Tracing (running through the code on paper step by step)•Explaining the code in English in the form of a trace (“first it does this, then it does that…”)

Concrete Operational

•Explaining the code in English in terms of its function (“This code sorts an array from smallest to largest”)•Using diagrammatic abstractions•Completing conservation exercises (e.g. “This method is not finished. Complete is so that it returns …”)•Completing reversing exercises (e.g. “Heres some code that does X, Y and Z. Write some code that does the reverse: -Z,-Y then -X.”)•Transitive inference (where a student might have to hold several possible program states in mind to answer a question, or generalise a system’s response by reading a fragment of code)

Adapted from Concrete and Other Neo-Piagetian Forms of Reasoning in the Novice Programmer, R. Lister, Uni. Sydney, 2011

Page 11: Textual programming in key stage 3

Example

Page 12: Textual programming in key stage 3

Example questionsA hierarchy of questions could go something like:

•What does the command on line 8 do?•What about those on lines 2 and 3?•What lines are any numbers on?•What’s different about the numbers on lines 6 and 7 compared with line 5?•What lines mark the end of a Ruby block?•What does the number in line 5 do?•What about those in lines 6 and 7?•Describe what happens in lines 5 to 10.•Draw on paper what you think this program does.•Can you explain in words what you think this program does.•Draw a flow chart that represents this code

Page 13: Textual programming in key stage 3

Small Basic Example

Page 14: Textual programming in key stage 3

Python Example

Page 15: Textual programming in key stage 3

Software & Programming

(Lesson 1: An introduction using Ruby)

Page 16: Textual programming in key stage 3

EXECUTABLE

Computer programs

Utility programs – e.g. virus scanners, backup

Apps – e.g. word processors and spreadsheets

software

{

Code

if(x==2){ print “foo”;}

com

pile

d

orin

terp

rete

d

loaded into RAM

CPUThe Central Processing Unit (CPU)

The CPU is the core of the computer. It ‘processes’ all the computer programs.

Page 17: Textual programming in key stage 3

Fill in theblanks

Page 18: Textual programming in key stage 3

Some Ruby Code

Look at this code What does it do?

Page 19: Textual programming in key stage 3

What about this?

The code... The output...

Page 20: Textual programming in key stage 3

Enter and run these programs Press the button before entering the second

one

Program 1 Program 2

In your books, go through each program line by line and try to explain what each line does.

Page 21: Textual programming in key stage 3
Page 22: Textual programming in key stage 3
Page 23: Textual programming in key stage 3

Conservation exercise

Page 24: Textual programming in key stage 3
Page 25: Textual programming in key stage 3

Diagrammatic abstractions & starting to write their own code (transitive inference?)