I just finished An Introduction to Interactive Programming in Python on Coursera, which is taught by Rice University professors Joe Warren, John Greiner, Stephen Wong, and Scott Rixner. This course has the rather unique approach of teaching programming by building games of increasing complexity, instead of teaching programming language syntax with a plethora of dull exercises. Overall, it was an excellent experience, and thoroughly enjoyable. Most of all, it was great fun.
I originally signed up because I was interested in the structure of the course. I liked the whimsical style of the instructors, and before I knew it, I was sinking a couple hours a week into programming games. Games were only used as a vehicle to teach programming, though. I think this is a much more attractive approach than coding a dreary CRUD application. Presumably, more students would stick with computer science or mere programming if they were presented with more interesting application domains. I certainly have never heard of teenagers who learned programming on their own because they wanted to write a CRUD app in Java. Games, on the other hand…
Pedagogically, the class was excellent, since it focusses on practical examples first. For a beginner, this is surely much more helpful than the misguided attempt of introducing rigorous definitions for their own sake. The content was similar to a typical introductory programming class that is taught using Python, such as MITx’s 6.00 or Udacity’s CS101. Yes, object orientation is covered, and so are common data structures like lists, sets, dictionaries and tuples. Even more advanced concepts like list comprehension were taught.
Now, let’s talk about the games you’ll write in the course: the first project is an implementation of rock, paper, scissors, lizard, Spock, which uses console output. The week 2 project is not much more complicated: it’s the guessing game. You know, guess a number between 1 and 1000. This project also served as a vehicle to introduce binary search, and basics of GUI interactivity. Week 3 was only a minor step up, covering modulo arithmetic by programming a stop watch, and implementing a “game” on top of that: try to stop the counter at the start of a second. Since the counter keeps track of 100 ms segments, this is rather difficult.
The fun started in week 4, though, which focussed on Pong, using simple vector graphics. Pong may not be very exciting nowadays, but it’s quite satisfying to play a round or two (against yourself) once you’ve implemented all game mechanics. It felt satisfying just seeing the ball physics in action. Quite a few students seemed to have struggled in week 5 with the implementation of Memory, as it involved more complex game state and manipulations. In Pong everything is visible all the time, while in Memory cards aren’t always exposed. As you can see from those examples, the assignments got progressively more complex, and they required increasing sophistication.
The most time-consuming project was probably Blackjack, the week 6 project, which implemented a simplified rule set of that game. The addition was to work with tile maps. The last two weeks tied everything together with an implementation of Asteroids: game physics, sound, tile maps, collisions, game state, it’s all in there. Despite being the most elaborate project, it was very straight-forward. As such, it was a rewarding conclusion to this course. Here’s a screenshot:
The support structure of this course was excellent, too. You could even email a help desk at Rice University if needed, and each week, a support thread was started in the forum that discussed the most common stumbling blocks. Examples of programming concepts were plentiful, and supplementary exercises helped reinforce concepts, if you needed it. I didn’t have to resort to any of those resources, but knowing that they were there was reassuring. I also appreciated that materials were posted early, on Saturdays, which gave you a head start, and made it much easier for me to find the time for this course.
There were only a few blemishes. One quibble I had was that in one of the later projects some “Java in Python” was taught as students were asked to write a “getter” method. However, in Python you can just access the attributes directly. Peer review of the weekly assignments worked well. However, the grading rubrics focussed merely on the exhibited functionality of the programs, not on the actual code. I found this questionable since it may reinforce bad habits. A grading rubric for “style” may be a reasonable addition to future iterations of this course.
To summarize, An Introduction to Interactive Programming in Python is a great way for a beginner to get started with programming. This course is also interesting for more experienced programmers, since you’ll be implementing simple games. I certainly found this enjoyable. Granted, it probably won’t provide much of a challenge if you’ve made it through an introductory programming course already, but it should be quite entertaining.