Scratching the Itch - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Scratching the Itch

Description:

The primary purpose of the Data statement is to give names to constants; instead ... a good algorithm, rather than introducing dumb example because it is simple ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 11
Provided by: jeffp81
Category:

less

Transcript and Presenter's Notes

Title: Scratching the Itch


1
Scratching the Itch
  • Jeff Parker, Merrimack College
  • Scratch_at_MIT

The primary purpose of the Data statement is to
give names to constants instead of referring to
pi as 3.141592653589793 at every appearance, the
variable Pi can be given that value with a Data
statement and used instead of the longer form of
the constant. This also simplifies modifying the
program, should the value of pi change. Fortran
manual for Xerox Computers
2
Outline
  • Setting
  • Teaching CS1 to students that didn't apply to MIT
  • Problem
  • Hard for students to follow what a program is
    doing
  • Harder for students to write programs
  • It takes a long time to get to the good stuff
  • Course Goals
  • Computers can do interesting things
  • Computers do only what you program them to do
  • Good News
  • Scratch can help us teach these points and many
    other things
  • Bad news
  • They need to move from Scratch to C or Java at
    some point

3
What do we use Scratch to teach?
  • We start CS1 with 2 weeks of Scratch
  • We cover
  • If Statements
  • If touching sprite2
  • Loops
  • Simple loops w/ observable events
  • Objects
  • Sprites have state (such as position) and
    behaviors
  • Plugability
  • Recursive nesting (see next slide)

4
What do we use Scratch to teach?
  • Plugability
  • An if statement has a condition
  • A condition is a Boolean expression
  • An expression can compare two integer expressions
  • Integer expressions can be a number or a function
  • Sample function RNG, which uses expressions

5
Difficulties
  • Equations are a difficult concept to grasp
  • Students do not understand equations
  • Heck, most adults don't understand equations
  • "Each equation in the book would halve the
    sales."
  • Stephen Hawking
  • Students do not understand assignment
  • Students have trouble with the notion of a
    variable
  • See the work of Dietmar Kuchemann and Zalman
    Usiskin
  • And variable in CS is different from a variable
    in Math
  • They really have trouble with notion of an
    indexed variable

6
Simplicity of Model
  • There is (almost) no syntax in Scratch. Compare
  • Further, there is no loop index
  • for (int i 0 i lt 10 i)
  • pop()

7
Examples
  • Focus on one issue reading or writing a simple
    loop.
  • for (int i ... i lt size i)
  • desti sourcei // copy
  • if (ai gt max) // Find max
  • max ai
  • ai-1 ai // Shift left
  • fibi fibi-1 fibi-2 // fib
  • yi yi-1 deltafprime(xi, yi) // Euler
  • if (si ! ssize - i - 1) // Palindrome
  • return NOT_PALINDROME
  • for (j i j lt size - 1 j) // Bubble Sort
  • if (aj gt aj1)

They have trouble thinking about the index This
doesnt mean that they cannot understand these
algorithms it is expressing it formally that is
difficult
8
Simplicity of the Logo model
  • for (t 0 t lt ) // Closed form expression
  • (x, y) (x0 D t, y0 20 t t2)
  • for () // Integration Model
  • x x D
  • vy vy a
  • y y vy
  • for () // Logo Model
  • move(D) // x x D cos(q) y y D
    sin(q)
  • turn(f) // q q f

9
Transition from Scratch to C
  • Use the time with Scratch to cover algorithms
  • Introduce Single Stepping (Under Extras menu)
  • In the language of choice
  • Focus on programs with visible results
  • Relate new constructs to Scratch (see David
    Malan's talk)
  • They know the semantics just need to learn
    syntax
  • Postpone subscripts (indexing) and equations
  • K R style Filters
  • LISP style processing car, cdr, cons
  • Still allows interesting projects such as Igpay
    Atinlay

10
Transition from Scratch to C
  • Preserve the community let students learn from
    each other
  • Encourage students to work in pairs
  • Never say something a student can say
  • Foster a community of learners who listen to each
    other
  • Every student can do something right
  • Select their best work you can still suggest
    changes
  • Make your examples ones you would share with
    colleagues
  • Take the time to explain a good algorithm, rather
    than introducing dumb example because it is
    simple
  • Keep it fun!
Write a Comment
User Comments (0)
About PowerShow.com