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.

I assume you're familiar with the most basic techniques for program readability: naming, indentation and white space, symbolic constants and enumerated types, comments, and factoring out duplicate code. In this course 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 (what ``functions'' are ``called'') 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 and responsibilities 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, Object Pascal looks like Pascal with extra features, and CLOS (an acronym for ``Common Lisp Object System'') is a collection of object-oriented features added to Lisp. Other languages are less closely tied to specific forebears: the Java language descends from C++, but has significant differences, while Eiffel, Smalltalk, and Logo, despite some resemblances to other languages, are essentially new.

All this would be of little importance if object-oriented languages were as similar to one another as procedural languages: if you know Pascal, you can learn C, PL/I, Modula, Ada, etc. in a few weeks with a good manual. But OOP is new enough that agreement has not been reached on its underlying principles. C++ and CLOS, to name two, 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. So in this course we'll compare several different object-oriented languages: Smalltalk, C++, Java, Objective C, Object Pascal, and CLOS (actually, we'll use a package of OOP extensions to Scheme called ``tiny CLOS''). Each approach has advantages and disadvantages, and by the end of the semester you should be able to decide which approach is most suitable to any given programming task.


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

Dr. Stephen Bloch
Thu Jan 23 09:05:55 EST 1997