next up previous
Next: Prerequisites Up: Computer Science 272 Software Previous: Computer Science 272 Software

Subject Matter

This course, in a few words, is about how to organize a computer program. The skill of organizing a computer program well has several benefits. First, you'll understand your own program better if it's organized in a way that ``makes sense''. Second, you can find and repair bugs, and make enhancements, in your program more easily if it's organized in a way that makes it easy to modify. Third, other programmers can read, understand, repair, and enhance your program more easily if it's organized according to these same principles.

Up to this point in your computer science career, you've typically been given a programming assignment, written it by yourself, turned it in, and gone on to the next assignment. This is not what happens in the real world! In the real world, most computer programmers spend most of their time, not writing new programs, but debugging and modifying old ones, including old programs written by other people. This places an additional burden on both programmers: the new programmer must be able to understand and modify somebody else's program, and the original programmer must write in a way that can be understood and modified easily.

The programs you've written up to this point are typically a few dozen lines long. In the real world, most programs are thousands, perhaps even millions, of lines long. You may be able to write a twenty-line program without planning, keeping the whole thing in your mind at once. But that seat-of-the-pants approach doesn't work for large programs. No human being can keep a thousand-line program in mind all at once without organizing and breaking down the program into manageably small, coherent pieces.

The course will start with some of the most basic techniques for program readability: naming, indentation and white space, symbolic constants and enumerated types, comments, and factoring out duplicate code. We'll go on to the more advanced techniques needed for problems of realistic size: abstraction, encapsulation, information-hiding, and modularity.

In particular, we'll discuss a strategy, currently very fashionable in computer-programming circles, called ``Object Oriented Programming'', or OOP. To get a first impression of OOP, compare the programs you've written so far to English sentences. Each statement performs a particular action, corresponding to an English verb, and your main interest is what actions are performed in what order. In the English analogy, you're concentrating on verbs. The OOP approach can be thought of as concentrating on nouns instead: rather than thinking primarily about a sequence of actions, we think primarily about a collection of objects, the properties of each, and what can be done with each one. The experience of many professional programmers shows that this approach usually works better for organizing large programs.

OOP usually requires that the programming language contain special object-oriented features. Object-oriented languages are often invented by adding such features to an existing language: for example, the object-oriented language C++ looks like C with some extra features, while CLOS (an acronym for ``Common Lisp Object System'') is, as its name implies, a collection of object-oriented features added to Lisp. (We'll actually use Scheme, rather than its ancestor Lisp, extended with CLOS features.) However, C++ and CLOS differ not only in their base language, but in their whole philosophy of object-oriented programming. Each provides support for certain kinds of object-oriented programming that would be unthinkable in the other. Each approach has advantages and disadvantages, and by the end of the semester you should be able to decide which approach is more suitable to any given programming task.



next up previous
Next: Prerequisites Up: Computer Science 272 Software Previous: Computer Science 272 Software



Dr. Stephen Bloch
Sat Jan 20 11:57:16 EST 1996