Good-bye

'hello world'

Rethinking Teaching with Python


Vern Ceder

Canterbury School, Fort Wayne, Indiana

CP4E?

CP4E

  • but for what value of E?

Having just signed to write Head First Programming with Python for O'Reilly, I am very much interested in making programming accessible to everyone

What I used to do

#include <iostream>

int main()
{
     cout << "hello, world";
}

This is the C++ code a student would have written for her first program in 1997

What I wanted to avoid

class hello{

  public static void main(String args[])
  {
     System.out.println("hello, world");
  }
}

This is the Java code that I feared a student would have to write for her first program in 2003

What we got instead

name = raw_input("What is your name? ")
print "Hello,", name

This is the Python code that a student would write for her first program after the adoption of Python in 2001

Only two lines and interactive...

and...

>>> 22/7
3
>>> 22.0/7
3.1428571428571428
>>> "spam " * 5
'spam spam spam spam spam '
>>>

This is a typical session in the Python shell, evaluating expressions...

Students didn't like it

There was just one problem...

  • students hated it

After the required exposure in 9th grade, only hard core geeks continued in programming.

I foolishly gave a survey

How do I know?

  • I asked

I gave a survey as a control for comparison with one given to our 8th graders in connection with my PyCon 2006 talk....

Survey Results

Out of 20 kids

  • ONE thought it was great
  • TWO thought it had some good points, but was pointless
  • the rest thought it was confusing, boring, too hard

The one who liked it is not the one to worry about...

What I realized after the survey

And they were right

The approach needed to re-examined

Where we had gone wrong

We Kept All the bad stuff

  • Text based
  • Boring exposition
  • The same old chestnuts - even that damned swimming pool
  • Problems whose only purpose was to illustrate the code

The swimming pool of course is the program where you calculate the volume of swimming pool based on user input. A classic boring, only-for-the-sake-of-practice program.

But we added more

and we added the shell

  • what's an expression?
  • what's the state of the system?
  • what's a program?

Bad ideas

Boring?

  • Are you kidding?

More Bad Ideas

Confusing?

The solution

The Solution

  • reduce expository text
  • graphics, not text based
  • no shell

In practice

In Practice...

  • hello world --> red dot
  • examples and partial examples
  • practical rather than theoretical

LiveWires is the graphics package used - developed for that age group.

Examples

Feedback

Responses

Recommendations

Recommendations

Recommendation #1

Innovate

Python is not C - let's not continue to teach programming as though it were...

Recommendation #2

Keep it interesting

Motivation is key - make programming problems interesting to your audience.

Recommendation #3

Evaluate

It is vital to get feedback on how well your students are doing and what they think of the course.

Recommendation #4

Recruit

I've used the same materials as used for the students to offer tutorials on Python at teacher conventions with enthusiastic response. If we can reach them and give them the knowledge, there are teachers who want to teach programming.

Find me at...

Vern Ceder

http://tech.canterburyschool.org/tech/VernCeder