Saturday, February 27, 2010

Thrift Store Find: The World of Objects



The internet really is amazing, when you think about it.

A few weeks ago I found an old VHS copy (never opened before) of THE WORLD OF OBJECTS with Philippe Kahn.  With VHS tapes going for 50 cents, I didn't even hesitate to throw this one in my cart.  Then I found it hosted on Google Video, which was convenient.

Yesterday I watched it.  What was amazing to me about it was how little things have changed when it comes to Object Oriented Programming.  The video hammers out the three main facets (Encapsulation, Inheritance, and Polymorphism) as if they are revolutionary concepts in programming.  Well, at one time they were.

My students, though, have never lived in a pre-OOP world.  For them, the usual responses range from a nonchalant "oh, okay" to a somewhat amused "well, duh!"  I remember Don Slater giving a demo of Alice 3 at Carnegie Mellon University.  He made the comment, "you know, as far as objects go, students 'just get it'."  He was right.  In fact, I've found it easier to teach objects than it is to teach functions, which is a strange twist on reality if you grew up programming BASIC on a Vic-20

This last week during our programming club at Skyline, one of my best programming students and I talked about redesigning old video game classics like Breakout using OOP principles.  We each had a piece of paper and were soon diagramming UML boxes for a Breakout clone.  It was pretty clear to me, right then and there, that a) you can't go home again, and b) you wouldn't want to anyway.

This weekend "just for fun" I'm programming the Breakout clone and also a cellular automata simulation of forest fires that I came across in a great book on computational programming.  For the Breakout clone I used some of the design that my student and I had come up with, but toned down the OOP a little (The paddle class and ball class should be quite re-usable).  But for the forest fire sim, I sat down and just started coding.  That turned out to be a mistake.  I hadn't fully planned the program on paper, and I know that the grid class I write will be used by students in the future.  So now I'm back to paper and UML diagrams, thinking through what a grid object's attributes and methods should be.  At least when I do start writing the code, I'll have a good plan in place.

Processing will be used for this, and the results will eventually appear on Skyline's Processing Playground page.

Saturday, February 20, 2010

The Short Answer

 
 When people ask me what the goals of a high school computer science department are, I have a supply of various answers that range from vague and obscure to complex and convoluted.  It's much easier to just distract them by walking them through a typical class and asking them to talk to the students one on one.  To learn computer science is to experience computer science, and explaining that to an outsider can be a challenge.

Ever notice how computer science has been applied to nearly every aspect of human life?  Even domains that are the most blatantly "human" in nature, like linguistics, have proven to be fertile ground for computer science.  Computers, ironically, seem to be crucial in our quest to fully understand what it means to be human.

Today I spent some time developing a simple pong application using Processing.  With each new version of the program, I decided to heavily comment my code and hopefully make it clear to my students why certain choices were made.  Basically it goes from a simple paddle and ball to a game with obstacles, a scoring system, and an evolving complexity that is typical for even the simplest programming projects.  

Little things like using variables rather than hard coding coordinates throughout the code are covered, but so is the much larger picture that can only be clarified by the application of Object Oriented Programming principles.  It didn't take long, really, and my simple little pong application was seriously crying out for better design.  

Having students learn that while actually programming their own creations is reason for celebration.  I have seen it many times since moving over to computer science from teaching math full time.  I spend a lot of time developing curriculum, but fully realize that those moments are simply not the result of a particular curriculum.  Rather, they result only after a lot of time is spent nurturing the student through the cold and impersonal early days, when syntax errors and debugging can really take their toll on a student.   I think I draw on my years of teaching middle school most when I am helping beginners learn programming.  You simply can not be the "expert at the front of the room," or you will lose them forever.  You have to deal every day with the fact that your actions will prevent the inevitable from happening: a small proportion of your class (often boys) will soon be seen as "having it", while all the rest will be forever defeated at the thought of exposing themselves to the humility of writing code from scratch.
How do I do this?  I visit with my students every day.  I try to find those that are the least likely to approach me, and I sit down next to them and talk to them while they program.  I look to pair up students as much as possible for support.  In short, I throw a lot of the old wisdom of teaching out the window, and focus much more on human feelings than on programming skills.  If students taste some early success on programs of their own choosing, the stage is set for the learning of computer science principles that will form a foundation for exponential growth that can be witnessed in few other domains of education.  It's hard to explain that to someone outside of the computer science education, but the same way a simple application like, say, pong can develop from a ball and a paddle to a major time-sucking, addictive game--well, you soon realize that same exponential growth in your students, as they threaten to leave you behind as they become more and more fluent in their command of a computer and computer languages.

So, that, blog reader, is the goal of our computer science department.  In time we will develop official standards that basically say the same thing, but for now, this will have to serve as the short answer to the question.

Saturday, February 13, 2010

Processing

 

Every once in a while you discover something that you can hardly believe exists.  For me, that would be Processing.  Spawned at M.I.T., Processing offers users a powerful way to create visual and sonic digital art.  The fact that this is a free and open source project makes it an easy choice for supplementing a high school computer science curriculum.  Visit the exhibition pages and you can easily see why my students and I are pretty excited about Processing.

Our school has always had a top notch visual and performing arts program.  We also have a very diverse student population.  In our district, we easily have the most minority students, English Language Learners (ELL), and students that qualify for free and/or reduced lunch.  We have our challenges, certainly, but we also have one of the best kept secrets in our district: our school truly values the individual student and encourages students to think for themselves.  
I've read the data on the miserable state of women in computer science.  I think of that every day.  I get praised for having a relatively large number of female students.  I have also reached out to our Special Education department to encourage their students to take my classes.  Being certified in ELL instruction, I am pretty much assured that all of our ELL students will take my classes.  If you are serious about tacking the access and gender issues in computer science, you fight the battle daily.

Processing will help me fight the battle.  I think of Joanna, in my intermediate programming class.  She works her butt off learning Python, and still deals with syntax errors and bugs that have an annoying way of appearing just before she makes a breakthrough in her programming skills.  When she does complete a program, her work paints the screen with a style and grace that is all her own.  Still, I wonder if she would ever choose to do this "for fun."

So this weekend I am changing horses in midstream and developing some starter units using Processing.  We will have to run it off flash drives for a while, as it is not installed in our lab, but I know it will be worth it.  

I got a surprising email this week from a former student that I had lost track of.  She wanted to tell me that she is now attending Carnegie Mellon University on a scholarship and has every intention to pursue a career in computer science.  She wanted to thank me for teaching her how to program in a little computer club I used to run back when she was in the sixth grade.  Suddenly all the stress and frustrations of teaching seemed insignificant.  What more could I ever hope for than to have one of my students serving as a role model for women in computer science?  I could die now and not be unhappy in my handful of accomplishments.  :-)