CS 1 Fall 2008

Big Idea

Games Programmers Play

Wednesday, December 3, 2008


As a child, it may have taken you some time to learn to play formal games: to wait your turn, understand the rules, and to play strictly by them. Ultimately, you had to develop strategies that would optimize your chance of winning.

After you'd learned a few games of one genre, you probably found it easier to pick up other similar games. Since you knew the key operations and the standard motifs, you simply needed to learn the new rules and adapt your strategy.

And so it is with computer languages! Learning the first one requires that you internalize a broad new set of rules, "playing pieces", and strategies. Once you've done that, new languages are largely a matter of comparing and contrasting the playing pieces and assimilating the new and different rules. This is particularly true once you have already been exposed to the major concepts and constructs (all the kinds of rules you might encounter).

In Scheme we started from a very simple set of rules. We added constructs as we expanded our set of rules, and the game got more powerful and more interesting. By the end of the course, we've learned a very rich game which incorporates most of the components we'll see in other games (languages).

As an example, today we look at Java. The playing pieces look a bit different. But we'll see that we already know most of the moves and a good bit of strategy. We need to learn a few new rules and forms, but they build readily on what we already know.

The rules for computer languages, like most games, can be assimilated quickly once you know how languages (or games), in general, work. In short order, you can read any program and understand what's happening. (But, like most games, mastery comes with practice and experience.)

At the end of CS1 you should be comfortable with most of the rules and kinds of rules which show up in computer languages. You should be able to write small programs in Scheme which precisely achieve your desired goals. And, you should be able to quickly pick up other languages. CS2 and CS3 are more about helping you mature and master strategy -- so that you can conquer large problems with a higher likelihood of success.