4

Teaching

Teaching Programming With Scribblers

Scribbler tank robotParallax has been making a tank robot called the Scribbler for a while now and in fact will be selling a second version starting August 2010.  It’s a cute little blue ‘bot that I’ve been using to pretty good effect in my Creative Computing class using an add-on board by the Institute for Personal Robotics in Education, a Bryn Mawr, Georgia Tech and MSR endeavor.

The Scribbler itself comes with a visual programming interface I haven’t explored much at all but the add-on board (Fluke) allows for over-the-air programming in Python.  I teach Creative Computing in Python so I saw these ‘bots as a nice opportunity to expose students to an interesting problem space using programming tools they would already be familiar with.

At Bryn Mawr and Georgia Tech, the robots are used as the primary context for learning about programming but I’ve got some reservations about that approach.  I find the robots are fun for about two weeks and then their limitations really come through.  I would worry about irritating students by spending too much time with them so I introduce them late in the semester as sort of a ‘hey, look what you can do with what you know!’  I think it’s pretty satisfying for students to realize that all the concepts they’ve learned — iteration, conditionals, user input, variables, etc — can produce intelligent-seeming behavior in physical objects.  I also really like introducing students to the idea that information can be translated between forms to produce interesting effects.  For example, one exercise  I have students do makes their robot into something like a theremin by using light sensor values as beep frequencies.  Yesterday some students who had finished required activities were expanding on the idea of taking information in one form and using it in another to have their robot ‘sing’ an image by changing the beep frequency based on the amount of red in each pixel.  It was surprisingly nifty.

Issues I’ve run into:

  • Bluetooth is unbearably flaky — there are range issues, interference issues and so on.  Also, on Windows XP, the COM ports change constantly which is irritating beyond belief.  Every time the robot needs to be reset, students have to pair with their robot again and reload the libraries.  Pretty much unacceptable.
  • The myro library will inexplicably crash fairly frequently.  For example, it’s not uncommon for robots to stop being able to take pictures for a while.  The joyStick() command freezes all the time.  Again, very frustrating for students.
  • Everything is slow.  Moving is slow, taking pictures is slow, reading sensor values is slow.  It makes for a good lesson on embedded systems and their limitations, but again I think that’s only tolerable for about two weeks.
  • The sensors suck.  Sorry, but there’s no other way to put it.  The only two that work somewhat reliably are the light and obstacle sensors.  The others are worse than useless: they suck your time away and irritate you to no end.  Luckily I’d done enough playing around on my own to realize this before letting students loose on them.  The stall sensor, brightness sensor, line sensor, IR sensors are are mythical if you ask me.  It may be a myro issue, but I’ve never seen them give any sort of reasonable output.  Super frustrating, and again reduces the robot’s usefulness significantly.

People always ask me why I wouldn’t choose Mindstorms, especially given the limitations listed.  I’ve done enough outreach work with Mindstorms to have concluded that they’re great for mechanical engineering instruction but not so hot for learning to program.  It’s cool to be able to build custom robots but parts get lost, fall off and generally just take away time from programming so that was not an option I was willing to consider.

I do think the Scribblers were the right choice for what I’m doing.  At $200 each including the Fluke, they won’t break the bank and they’ve been very little maintenance.  I have 15 of them and they’re all doing fine even after a couple hundred students have used them over a year.  I know the Fluke looks fragile, but they’ve taken several face plants and been just fine.

I tried using them as an introduction to Python programming with students who had only used Scratch and I’ve decided not to do that again.  All the limitations are too frustrating in addition to trying to learn Python syntax and I’m afraid too many students walked away from the experience thinking programming was a huge time-sink with little reward!

I think these are the right robots to bring some excitement to a Python-based programming class for about 2 weeks and look forward to seeing the newer, beefier Scribbler 2.

(I recently gave a little training on using Python and Scribblers to the Puget Sound chapter of the CSTA.  My slides.)

8

Teaching

While loops gone wild

I hope that my students know that I too feel programming is hard.  In fact, I hope some of them realize that programming is exciting and meaningful to me in large part because it’s such a challenge.  When students complain about difficulty, I like to remind them that they’re in school to stretch themselves but sadly that
doesn’t tend to resonate much with them.  Go figure.

In Creative Computing, we recently spent time working with indefinite loops.  I think most introductory programming instructors would be shocked and appalled at how long we’ve spent primarily focusing on one
measly construct.  Indeed, while loops are a half-hour lecture in most college-level intro to programming courses.  But here’s the deal – while loops are hard.  What does it take to use a while loop properly? I’ve tried to think of all the little things necessary to know how to interpret and create code using indefinite loops but I’m sure I’ve forgotten bits and pieces! I poked around a little for formal articles with these sorts of breakdowns for various programming constructs but wasn’t very successful. Pointers?

Understanding while loops requires…

  • syntactic knowledge
    • start the statement with while, have some condition in parentheses, end the line with a colon then indent things that need to be repeated
    • valid boolean operators (assignment = vs. equality ==)
    • creating complex boolean expressions with and and or (for example, my students often write things like value == 2 or 3 which won’t work as expected in Python)
    • how to group statements into a block
  • understanding of scope rules
    • if I use a variable in my test, it has to have been initialized
    • if I create a variable in my loop, it won’t be available later
  • understanding of flow of control
    • if I make a method call in my loop body, that method is run then Python keeps executing statements after the call
    • if my condition stops being true somewhere in the loop body, that doesn’t make me magically jump out
    • the test is executed every time around the loop
  • converting between stopping conditions and continuing conditions
    • DeMorgan’s Law is hard

I have a lot of sympathy for students who take more time to synthesize all of this and I think it’s too bad that we don’t have more best practices on breaking concepts down into digestible pieces.  At the same time, I think CS courses are exciting for high-achieving students BECAUSE we haven’t figured out how to break things down into bite-sized chunks, yet!  Certainly, when I was starting my perpetual quest to learn to program, I found something deeply satisfying about looking at several examples of a construct to establish a model of how it works.  For students who are not used to considering an idea from different angles in an attempt to really understand it, it’s a deeply frustrating process.

I feel like this points to a deep need for differentiated instruction to  keep my top end students engaged without overwhelming my bottom end.  I’ve been trying to be more careful about giving students sample code that address sub-concepts one at a time and having different milestones so students at various levels can be successful.  Again, not really finding best practices but that’s probably because computing education is primarily done at the college level where it’s not much of a concern for instructors (or I don’t know where to look?).  Raymond Lister and John Leaney’s First Year Programming: Let All the Flowers Bloom does present some nice work supporting the idea of shifting my goals for weaker students to reading and interpreting code rather than producing entirely novel programs.

Of course, I don’t pretend to know what the right solution is.  One thing I think is underscored by the overwhelming list of concepts needed to understand the humble while loop is the importance of being very deliberate about the order topics are introduced in.  Sometimes I look at introductory programming course syllabi and I feel like concepts are just being thrown haphazardly into a pile instead of aiming to construct knowledge.  Strong students will probably be fine but what about normal people?!

7

Teaching

High School CS Teacher Job Description

I wrote this job description for a full time computer science instructor in an urban public high school a while back and realized it could be useful to share.

JOB TITLE: COMPUTER SCIENCE TEACHER

JOB SUMMARY:  The successful candidate will instruct a wide range of computer science courses which may include, but not be limited to an introductory survey course, Programming with Python, Web Programming (Javascript, PHP, MySQL), Programming Cellphones (Android or J2ME) and a college-level computer science course such as AP Computer Science.

Teacher will need to adapt existing curriculum to provide rigorous, motivating and relevant instruction to a broad range of students.  Teacher will be expected to leverage industry and academic connections
to provide students with enriching opportunities inside and outside of classes.

DESIRED QUALIFICATIONS
- Bachelors Degree in Computer Science or equivalent
- Valid related Washington State Career and Technical Education certificate, or eligible to obtain
- Experience in Java, Python, C, Scheme, Javascript, PHP, MySQL and other relevant technologies
- Prior experience teaching computer science courses, preferably at the college level
- Demonstrated interest, commitment and ability to work with students of varied academic levels and interests
- Interest in and experience with co-curricular coaching and advising assignments (FIRST robotics, Computer Club)
- Interest in and experience with curriculum design
- Interest in collaboration with instructors in other academic areas (mathematics, sciences, engineering)
- Willingness to share professional skills and curriculum with other teachers within the school and district

5

Teaching

Breadth courses in computer science

I currently teach three levels of high-school computer science courses – Exploring Computer Science, Creative Computing and AP Computer Science A.  I’ve learned a lot building and teaching all three, of course, but Exploring has been the most eye-opening.  While the national direction for high school and lower-division or non-majors college computer science courses appears to be away from programming and towards breadth courses, I’ve found teaching a motivating, rigorous and interesting breadth course very, very hard. (see Berkeley/Dan Garcia’s course The Beauty and Joy of Computing, the push for a new “Principles of Computer Science” AP course, the CSTA’s Exploring Computer Science curriculum for examples of recent trends)

So what?

My biggest problem with teaching a breadth course has been answering what I believe is the most important question for a teacher — “so what?”  Sure, it’s interesting for my students to know about binary, but what does it really gain them?  I focus on giving them an understanding of file size, image compression and the like — practical things — but my justifications often ring untrue even to me.  My students have drives that have multiple hundreds of gigabytes of capacity and Internet connections that transfer multiple megabits a second… why should they care about compression?  I talk to them about lossy vs. lossless compression so they can make good choices when, for example, editing their digital photos, but I really don’t think a computer science course is the right place for that kind of learning!  We need photography, art, marketing instructors who can relay that information in context.  Relatedly, it’s cool for students to know about binary search, but how is that actually useful if they can’t implement the algorithm?

What drew me to computer science was its incredibly powerful tool — programming.  As a kid, I wanted to build cool things and programming was much cheaper and instantly gratifying than metal-working or sculpture.  In a programming course, the “so what?” is clear: you can build stuff.  Not only that, but you can build things that are relevant to your every day life and that enhance products you already use.  I feel I have very little problem justifying what we’re learning in my programming courses because binary makes sense to discuss when we discover floating-point accuracy issues and binary search makes perfect sense when we’re trying to implement a simplified music library program.

I agree that programming is a tool — only a means to an end.  But it’s such a fantastic way of describing and formalizing important computer science concepts such as abstraction, complexity, etc.  Why shy away from it?

I have a rather pessimistic answer to the latter question: programming is too hard.  Unfortunately, many high school students  have little to show for their years of coursework.  In order to reach those students, courses have to be made easier.  It’s natural, then, that programming courses wouldn’t be particularly successful when competing with business communications, marketing and other “light” career and technical education options.  Thankfully, the school in which I teach is excellent and many students are not only ready for challenging courses but even exhibit frustration at course offerings that don’t challenge them.

Rigor

A breadth course in computer science is part history, part ethics, part anatomy… it’s hard to characterize.  What I’ve found is that rigor is extremely hard to achieve when topics aren’t covered in much depth.  In a typical breadth course, students spend something like two weeks discussing “algorithms.”  Of course, they don’t learn much programming, so they can’t really implement them.  So what can they actually do with the information?  Relatedly, how can an instructor check for true understanding?

I’ve found writing exams for Exploring Computer Science a frustrating experience since I don’t cover any one skill in enough depth for them to really have much to demonstrate to me.  I don’t like definition questions like “what is an algorithm” because that just encourages shallow memorization with little staying power.  What I’m interested in is, of course, reasoning about computational problems but it’s unclear to me how to do this when we don’t have a common language for expressing algorithms.

Overall, I have bright and motivated students who generally end up learning what I’d like them to and are thoughtful about what we discuss but I worry that this style of course, while more approachable for weaker students, also does little to encourage them to challenge themselves.

A programming course requires students to flex all their brain muscles.  To be successful, they need to have strong quantitative reasoning skills, they need to use the scientific method and they need to be writers and designers.  Conversely, their quantitative and scientific reasoning skills are strengthened while they explore new types of writing and designing.  There’s built-in rigor.

Materials

There are tons of programming books from the classic K&R from which I first started learning C to my personal Java favorite (no bias here, of course), Building Java Programs.  Not only that, but there are plenty of great online resources — Nifty Assignments, Fred Swartz’s Java Notes, full course outlines with slides, full assignment sets and so on.  It’s of course a challenge to pick and choose the most effective assignments and use resources in a coherent way, but overall, pulling together a compelling beginning programming course should not be too hard.

What is there for a breadth course?  Certainly, many colleges have experimented with such courses and textbooks exist including Computer Science: an Overview, Computer Science Illuminated or Invitation to Computer Science.   I haven’t been too impressed by these books though I have to admit I haven’t reviewed them in any sort of depth.  My general impression has been that a significant chunk of content is obsolete by print time, that the concepts are presented too abstractly for students to really care and that transitions from topic to topic are rarely smooth.

When it comes to assignment ideas, a lot of what the textbooks cited above do are a mix of web publishing and “web scavenger hunts.” I always feel uncomfortable with these types of tasks — are they computer science?  Unfortunately, that’s what I end up with myself.  In fact, next Tuesday, my students will be spending an hour looking up definitions and sources for various aspects of software engineering.  It beats lecture, but how can they use the content without knowing to program themselves?

CSTA has recently been promoting a very interesting attempt at formalizing an introductory high school CS course called Exploring Computer Science based on some research conducted by Jane Margolis, an education researcher.  People I have a lot of respect for including Joanna Goode and Gail Chapman have worked on creating a curriculum to address lack of access to rigorous computer science courses.  I was so excited about this I pitched teaching the course to my administration and got four semester-long sections of it this year.  Unfortunately, when it came time to actually teach the course, I found most of the activities inappropriate for my students — childish, decontextualized, untestable.  I’m sure it works ok for their demographics, but it’s not something I can pull much from.  There went my primary source of materials.

Steering clear

Overall, I’ve had great fun with both AP CS in Java and Creative Computing in Python and the students have, too.  Exploring has been much harder for me, though, and much less of a hit with students.  Next year, I’m hoping to teach only one section of Exploring Computer Science and keep getting students excited about computer science through learning an exciting new skill — programming.

1

Travel

Multiculturalism.

Las Galeras is a noisy place: music, children laughing, birds singing, chickens clucking, pigs grunting, dogs barking, cats wailing… and these days construction sounds as a new aqueduct gets constructed nearby.  I’ve found it a nice background track to a lazy existence as we go from the beach to a hammock and back again.

We’re staying with a Dominican man and his American wife and spent Tuesday with a Dominican of German and Italian descent who has lived in New York, Paris and goodness knows where else, an American/Dominican and an older Italian couple.  It turns out I understand Italian fairly well but speaking back has been a bit more of a challenge.  By the end of the evening, after some beers and limoncello, we were congratulating ourselves on re-inventing Esperanto.

Our boat ride took us to two beautiful, deserted beaches: Frontón and Madama.  We enjoyed sandwiches from the local euromart and did some snorkeling.  Baracudas, sea cucumbers, fish of every color, huge urchins a sunken boat… wow!

Yesterday was a sit on the beach and read day and given the downpours today, it’s been more of a sit in a hammock and read day.  We’ve enjoyed the company of two middle school teachers from Boston.

Every once in a while I get a pang of ‘what am I doing in class next week’ but I’ve been pretty successful at bringing myself back to the difficult act of relaxing.

Sadly, though Yaw has learned a lot about the complex art of being white in the sun, I’m more burnt than tanned!

0

Travel

It feels good to be warm

24 hours after leaving home, we’re in a beautiful bed and breakfast in Las Galeras, Dominican Republic.  The five hour ride out from the airport was beautiful: lush hillsides, endless rice fields, friendly folks.  My Spanish is incredibly rusty but we’re getting by.  Tomorrow we sit our butts on the beach hoping that I will tan and not burn!

10

Teaching

Conditionals

Obviously, as I dive into high school teaching, I’ve been thinking a lot about mental models necessary for programming and about how to form these.  With 120 students of my own that I have had the opportunity to see through their very first line of code, their first loops, their first conditionals, etc, it’s become painfully clear that some students are much better prepared to think computationally than others.  This is old news to most people, but it’s just a much more intimate reality for me now.  I have no idea why, really… it’s not obviously correlated to their other grades or to their temperament.  It’s certainly not only the basement nerds or even the particularly interested — I have an superstar freshman girl in my AP class who I just learned ended up in my class by accident!

In my exams, I try hard to uncover what students’ current mental models are and have an opportunity to review them as necessary.  Although I know it’s unpopular among many, I have them write code on paper as well as solve mechanical code reading problems (Stuart is my hero and I steal all my ideas from him).  Reading their solutions is so eye-opening for me, especially since I can correlate with what I’ve seen them do at the computer.

I recently had my Creative Computing students take a Python quiz.  I asked them a fairly simple conditional problem to get them to define a function that takes parameters and check their conditional syntax.  Something interesting came out.  Here’s the problem:

Write a function choose_todo that takes two parameters: a temperature and a mood.  It should print what to do according to the following rules:

Temperature

Mood

Activity

60 or above

Happy

Go hiking

60 or above

Sad

Go fishing

Below 60

Happy

Go hiking

Below 60

Sad

Stay home

Ok, not particularly demanding or intellectually stimulating but the average and good students did this:

def choose_todo(temp, mood):
    if(temperature >= 60 and mood == "happy"):
        print "Go hiking"
    if(temperature >= 60 and mood == "sad"):
        print "Go fishing"
    if(temperature < 60 and mood == "happy"):
        print "Go hiking"
    if(temperature < 60 and mood == "sad"):
        print "Stay home"

And from EVERY exceptional student, we have:

def choose_todo(temp, mood):
    if(mood == "happy"):
        print "Go hiking"
    else:
        if(temp >= 60):
            print "Go fishing"
        else:
            print "Stay home"

I had the two happy cases be the same to see if they would recognize it, but I didn’t expect it to be such a black and white thing.  I pretty much could give this one problem and assign grades for the year.

The strong students somehow turned the problem around in their brain a bit more before starting to write than the others did.  Of course, the first solution isn’t wrong, it’s just… less satisfying?

This is not by any stretch of the imagination a skill that I explicitly taught.  I showed examples of concise code and discussed the advantages of making mutually exclusive options obviously so by favoring elif/else constructs over sequential ifs… but it was parenthetical at best.  Why do some people just ‘get it?’

Temperature

Mood

Activity

4

Uncategorized

Scootered.

I enjoy public transportation but sometimes (most of the time) it’s really inconvenient.  I don’t have time to always be on someone else’s schedule!

So now I ride a 2008 Genuine Buddy 125cc scooter.  Isn’t she gorgeous?  I filled the gas tank the other day and it cost me $1.50.

IMG_0033

6

Teaching

Troubleshooting.

It’s somewhat ironic that computer scientists often get asked for computer help that they can’t provide.  The truth is that software-writing ability generally doesn’t depend on utilitarian knowledge of Windows 2000, optical mice, wireless access points or printer drivers.  A number of computer scientists in fact take offense when asked for general computing help.  I guess they see it like asking a biologist for help troubleshooting a microscope or something though I’m not sure the biologist would be quite as offended.  I suspect they may act offended because they honestly don’t know.

I’ve always had a place in my heart for IT and happen to take pleasure in banging my head against strange computer (or more often, user) glitches.  And as unglamorous as diagnosing computer slow-downs or malfunctioning peripherals may be, I’d go as far as saying that my troubleshooting abilities are some of the most valuable skills I have.  What does it take to teach those?  Why don’t more people have them?

I recently received an e-mail from someone I really like and respect.  Our conversation went something like:

  • Short e-mail asking if I could help her fix her backspace
  • I ask whether it’s a mechanical problem and if so recommend popping out the key and cleaning it
  • She answers with more details: the backspace key doesn’t delete a selected region of text but works otherwise
  • I ask what program it’s happening in.  By this point, I suspect a Word or Office setting so I ask her to try in notepad, Outlook and Word
  • It’s only in Word
  • After a little poking around, I find the “typing replaces selection” setting

This is representative of the kinds of problems I’m asked to address — the issue is that most users don’t realize what their problem actually is.  In this case, the backspace key itself was fine but a software setting had changed.  It turns out that searching for “overwrite word selection” in Google provides a solution from Microsoft as the first hit.  Does it take a sophisticated understanding of the way computers work to know what questions to ask or things to try?

I’d like to try to help my students gain troubleshooting abilities but I’m not sure how to go about it.  Some of the things I’d like them to think about:

  • Eliminate hardware first (“is it plugged in?”  “Is the cable ok?”  “Is the socket ok?” “what if you plug it in elsewhere?”)
  • Applications have their own settings (“does it happen in application X?”)
  • Some applications are related (IE-Windows, the Office suite)
  • Rebooting solves a lot of problems
  • The right search query solves a lot of problems.  Coming up with it requires asking lots of questions until you have ideas on what might be causing the problem (hardware, settings, interaction between programs, malware)

Having “book knowledge” of troubleshooting isn’t particularly helpful, though.  I guess I can reproduce the backspace issue, for example, pretty simply and have them walk through how they would address it.  I wonder what students would do with that…

4

Uncategorized

Oh wow podcasts.

I was doing the dishes.  It was good because Russ Roberts was talking to me.  I’m not ashamed to say that podcasts have changed my life.  More specifically:

  • Planet Money: an entertaining look at serious economic issues.
  • Fresh Air: I used to be annoyed by Terry Gross.  Now I have no idea how that could have been possible and I wish she were my friend.
  • EconTalk: Russ Roberts from George Mason university (libertarian bastion) discusses economic issues of various kinds. I think I got into this one through Yaw.  It’s one of the best at giving me food for thought.
  • The Moth: hilarious stories every week.  I sometimes cry they’re so funny.  While doing the dishes.
  • This American Life: each week, of course, they choose a theme.  And they bring you three or four stories on that theme.
  • Radiolab: blend of science and culture with Robert Krulwich, NPR science correspondent.

No wonder I have forgotten what boredom even is… there’s just too much syndicated content for it.