Cookies and Code


Review: Udacity CS212

I recently finished CS212 Design of Computer Programs from Udacity, so I’d like to take some time out to let people know what I think of it.

First, I’d like to say that Peter Norvig is an intelligent guy. Just by taking a quick glance at his résumé, I see that he’s the Director of Research at Google, and he’s worked at places like NASA and Sun as well. He went to Brown University for a B.S. in Applied Mathematics and got his Ph.D. in Computer Science from UC Berkeley. That’s more than I could ever hope to accomplish in my life.

However, a deeper look into his credentials will reveal something that bothers me a little: he hasn’t had a software development job for over thirty years! Now I’m not going to claim that he doesn’t know how to program or that he doesn’t do any programming at his jobs, but I will say that I am confident that he is not a software engineer. In my opinion, he should not be teaching this course.

CS212 was supposed to be the follow-up to CS101. At a traditional university, courses take twelve to thirteen weeks to complete. At Udacity, they take seven weeks. Theoretically, this course should have been the equivalent of the second half of a university’s introductory computer science course. Well, as a tutor and peer leader (essentially a TA) for Rutgers’ CS111 Intro to Computer Science, I can assure you that Norvig really missed the mark on that one. In fact, he was so wrong that course is now listed as an “advanced” course on Udacity. Way to go, Pete.

So, how did this happen? Throughout the course, I paid a lot of attention to the course’s discussion board. I did this because, even as a junior in college studying computer science, I was sometimes puzzled with the material. I was able to get through it without too much trouble, but the entire time, I kept saying to myself, I can’t imagine that anybody without an IQ of 150+, a REAL background in computer science, or way too much time on their hands can make it through this course. At around week three of the course, my suspicions were confirmed. The discussion board was littered with confused and angry students, many of whom said that they were dropping the course because of how difficult it was.

The next question to be asked is, “why was it so difficult?” In the discussion board, Norvig said that he tried to base the course on the introductory computer science courses taught at MIT and UC Berkeley, which he believes is the reason that most students find it challenging. I respectively disagree.

Why do I think it was difficult for students? There are two simple reasons: Norvig doesn’t know how to teach students without much experience, and he does not understand how to write clean, understandable, maintainable code.

That last statement might sound like a huge slap in the face, but it’s the truth. If Norvig were to read this, I’m sure he’d be offended, but I take education (especially introductory courses) extremely seriously, so I must speak my mind.

Let’s check out a snippet of code that he wrote in the twelfth video of unit two (This would be somewhere roughly in the first fifteen minutes of the third lecture in a traditional university course):

houses, _, middle, _, _ = [1,2,3,4,5]

orderings = list(itertools.permutations(houses))

return next((WATER, ZEBRA)

            for (red, green, ivory, yellow, blue) in orderings

            for (Englishman, Spaniard, Ukrainian, Japanese, Norwegian) in orderings

            for (dog, snails, fox, horse, ZEBRA) in orderings

            for (coffee, tee, milk, oj, WATER) in orderings

            for (OldGold, Kools, Chesterfields, LuckyStrike, Parliaments) in orderings

            if Englishman is red

            if Spaniard is dog

            if coffee is green

            if Ukrainian is tea

            if imright(green, ivory)

            if OldGold is snails

            if Kools is yellow

            if milk is middle

            if Norwegian is first

            if nextto(Chesterfields, fox)

            if nextto(Kools, horse)

            if LuckyStrike is oj

            if Japanese is Parliaments

            if nextto(Norwegian, blue)

Yes, you just saw that; a twenty-line-long return statement! Who in their right mind would think that it’s a good idea to show this to someone who learned Hello, World eight weeks prior? I’m sorry, but that is unacceptable. If I was the CTO of a company, or anyone else with firing powers, I would shamelessly fire anybody who even thought about writing code like this. This coding style should not be taught at all, let alone in a course titled, “Design of Computer Programs.”

This pattern repeats over and over again in Norvig’s code. It’s as if he had just learned list comprehension in Python and wanted to teach an entire course on it.

If you’re still not convinced that this course was poorly taught, let’s take a look at some stuff I found in the discussion forums:

What is the time commitment for this course?

I invested a lot of time in this. I’m guessing it amounted to roughly the same, so 20-30 hours per week.

Twenty to thirty hours per week? That could be spent working a part-time job. I’ve never spent that much time on any course in my life. Not even for one week.

Now 212 become 312

I did the first session of CS373 and this is, by far, the harder course. I’m glad I took it though.

For the record, CS373 is a course on artificial intelligence. The second half of an introductory computer science course should not be tougher than learning the theory behind programming a robotic car.

Throwing in the towel

What makes me feel even worse is that even with all the people on the forums saying how lost they are, efforts aren’t being made to address that … Why can’t someone in charge just come out and say “We apologize to all our CS101 only students. We screwed up and misjudged the difficulty of this course. In the future we’re going to renumber it to CS412 and begin to offer more classes at a lower level of difficulty.”

Here’s some confirmation that the discussion board was filled with people who weren’t learning.

Does this class make anyone else feel like an idiot?

I’ve been taking this class as well as CS 253 and while 253 has been relatively easy to follow along with and a great learning experience. This class has felt like a punishment, I’ve been stuck on homework 2-3 for ages.

Again, the second half of an introductory course should not be more difficult than the course on web applications engineering. Also, this student is still struggling to finish the second week of the course on the 26th of May—the day before the final exam was posted. 

For my final (no pun intended) example, I’d like to present part of the first problem of the final exam. The problem was to create a program that calculated bowling scores. That doesn’t sound too bad, except Norvig decided to represent bowling matches as a list of integers. Let me demonstrate:

game1 = [10,10,10,10,10,10,10,10,10,10,10,10] # Perfect game (300)

game2 = [9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9] # Spares every time (190)

Do you see what I see? I see two lists of different lengths used to represent basically the same thing. Why would he present the problem like this? It does nothing but add complexity to the problem. You could argue that the point of a final exam is to be challenging, but the point of the course is to design programs properly so that programming is easier. Providing students with a horrible data structure to work with is no way to teach them how to design programs. This is how I would have represented the same games:

game1 = [(‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, 0), (‘x’, ‘x’,’x’)] # Perfect game (300)

game2 = [(9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’), (9, ‘/’, 9)] # Spares every time (190)

To me, this is makes much more sense. Now, every “game” has a uniform length, the additional logic required for things like spares and strikes are way easier to implement, and it’s easier to read! Each frame has its own tuple, which is the natural way to think about them. The last tuple has one more element than the rest, since that’s how bowling works. Throwing an arbitrary number of integers into a list is not the way to represent a bowling match, Norvig.

I really can’t stress enough how poorly-presented the material was in this course. Many people talked about how tough the course was, but the problem was not the material; it was the teacher. There is no doubt in my mind that if someone with better teaching—and software development—skills covered the same material, it would have been much more accessible to everyone.

Overall, I can’t say that I regret taking the course. I learned some stuff, and I definitely got a lot better at reading unmaintainable, way-too-clever one-liners. However, I would never recommend that anybody take this course unless they want to get better at reading through poorly-styled code.

My rating: 4/10.

I will review the other two courses I took, hopefully sometime this weekend. The posts won’t be anywhere near as negative or as long as this one.

June 3rd, 2012 4 notes #Computer Science #Peter Norvig #Rant #Review #Udacity #CS212
  1. utonesm reblogged this from grardb
  2. grardb posted this