By the time you’ve sorted out a complicated idea into little steps that even a stupid machine can deal with, you’ve certainly learned something about it yourself.

—Douglas Adams, Dirk Gently’s Holistic Detective Agency

Programming is about taking an idea and formulating it - just so - for a computer system to execute it. Computational processes are the infrastructure of the digital everyday, defined and refined by some eighty years of programming work. But programming is also great for learning by experimentation, play, and creativity. To implement an idea you will need to formalise and understand it as a computation. To implement it well it is necessary to know how computing works: about the principles of the machines we use, the resources required, and good programming techniques.

The following course notes for CS-A1120 Programming 2 we will introduce you to these matters while working on different programming exercises.


We will begin with a warmup round (next in this introduction) where we repeat some of the basic lessons of Programming 1. After this Programming 2 begins for real in Module I: The mystery of the computer, where we will be looking into how a computer is built from basic logic gates up to a processor unit.

Once we have this foundation Module II: Programming abstractions and analysis will look at programming techniques and how to begin estimate the efficiency of a program. We end the course with Module III: Frontiers and a look to the future.

All in all, the course has 11 rounds of course material and associated exercises . You can find links to the modules and their rounds in the left-hand context menu.


Before you begin studying this course material and taking on the programming exercises, you may want to read the Appendix: Instructions to see out how to set up the Scala console, the programming tools, and work with the exercise projects.

In many cases the reading material contains Scala code that you can immediately copy and paste into a console and witness what happens. Indeed, perhaps the single most important skill that an aspiring student of programming should learn is to play and interact with the machine.

Accordingly, please do make sure that you know how to start the console.

Again, warmly welcome to Programming 2. Click to the next page to get started with the Round 1 material!