Monthly Archives: June 2013

Review: CS201: Elementary Data Structures — Saylor Foundation

Saylor’s CS201: Elementary Data Structures follows their three-course introduction to programming sequence. The course is a standard data structures course, covering arrays, stacks, queues, graphs, and hash tables, and their implementation. As in previous courses, some segments were taught comparatively. For instance, implementations of a stack were shown in C, C++, and Java. This is a nice touch, although those languages are a bit too similar to lead to interesting insights.

I don’t think the C-family of languages is particularly suited to teaching data structures and algorithms to beginners, though, since they introduce a fair amount of “accidental difficulty” that is due to the syntactic complexity of those languages and not the subject. As a consequence, two of the eight units dealt with pointers and references in C++, and dynamic memory allocation, respectively.

Apart from data structures, an intro to the analysis of algorithms (big O) was provided, which was subsequently applied to a number of searching and sorting algorithms. A prominent omission among the sorting algorithms was quicksort, though.

Overall, this course is a great complement to the many introductory programming/CS intro courses that are available online. I just checked the EdX, Udactiy, and Coursera catalogues, and there is still no dedicated course on data structures available. This means that for the time being, Saylor’s offering fills a void.

My only criticism relates to the final exam. Saylor continually improves their courses, and is very receptive to feedback, so there is a good chance that the few mistakes I spotted will be corrected soon. I don’t want to discuss specific exam questions, but to give you one example: one question asks you to identify a sorting algorithm that is unsuitable for large arrays. However, they all exhibit quadratic runtime and thus were all unfit. Yet, the answer choice “none” was seen as wrong. The expected answer was presumably that bubble sort was unsuitable for that task, but I don’t want to select an answer choice that conflicts with reality just because the examiner (or grading script) might expect it. Some other questions were on C++ syntax, which I found questionable in the context of data structures. This wasn’t a big issue, but it surprised me nonetheless. Thus, I think that it would be helpful if Saylor either offered a sample exam, or expanded their list of learning outcomes to reflect the content of the exam as well.

[Addendum: I emailed Tanner Huggins at Saylor Foundations who quickly replied to me, saying that he addressed the issues I’ve brought up. He also wrote that Saylor courses eventually go through a peer-review process, where feedback on courses and exams is solicited from qualified faculty members, and that Elementary Data Structures hasn’t gone through this process yet.]

Review: An Introduction to Interactive Programming in Python — Coursera

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.

As teaching platform an online IDE named Code Skulptor was used, which implements a subset of Python 2.6 in JavaScript. Two bundled multimedia libraries make it much easier to write games. Code Skulptor provides syntax highlighting and code folding, i.e. the ability to hide the definition of a function. This environment worked very well for most of the course. The last few assignments led to code bases in excess of 200 lines, which made programming in the browser a bit awkward, though.

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:


RiceRocks: An implementation of Asteroids

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.