1. About this course

Part of CS:2820 Object Oriented Software Development Notes, Spring 2021
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science


This course assumes two semesters of prior programming coursework in a programming language such as Java, Python, C++ or other languages. If your experience is in older languages such as C, or Pascal, you will have some difficulty, and if your experience is largely in BASIC, COBOL, or FORTRAN or other unlikely antique languages, you will really need to work.

From the first programming course, you should have learned the basics of programming. How to write programs involving loops, if-then-else constructs, and function or method calls. You should be comfortable with simple variables, arrays and perhaps the outside view of several container classes.

From the second programming course, you should have learned something about data structures and algorithms. Lists, queues, binary search, lexicographic trees, sorting, and several recursive algorithms. The formal analysis of algorithms is a more advanced topic, but you should have seen enough to develop an intuition for the fact that some algorithms are potentially much faster than others when used to achieve the same goal. Consider for example the difference between binary search and linear search, or the difference between quicksort and bubble sort.

In general, programming assignments in those prerequisite courses are short, rarely amounting to more than a few hundred lines of code, and frequently under 50 lines of code. (Yes, the "line of code" is a horrible way to measure program size, since any program can be converted, with very little effort, into a program that is twice the size and does nothing new.)


Previous offerings of this course have used several different languages, but what matters is, this is not a course about a specific programming language. You know how to program, and learning the syntax of a new language is not all that hard.

It is noteworthy that the programming languages you are likely to have learned in any intro course taught in the last 20 years all support object oriented development, but the small programming assignments you had in your intro courses are unlikely to do more than use built-in classes, and in a second semester course, while you may have implemented a new class, you didn't really need to do so except that it was assigned. This is a natural consequence of small programming assignments.

The need for something like object oriented programming is not apparent until you get into large problems. Try to write a digital logic simulator capable of simulating a complete CPU at the level of and, or and not gates. Try to write a compiler, try to write a spreadsheet package, or any of many other large applications, and you will find that the story is quite different. If object oriented programming had not been developed already, you would be very likely to re-invent it.

This course, therefore asks you to work through a large programming project, large enough that you really need to use objects and other abstraction tools in order to get any traction on the problem. Programming in the large will ask for more than objects, it also requires management, documentation and methodology.

When you write small programs, who needs documentation? Here is an example, written in the old C programming language. The fact that you don't know C should not matter to your understanding of this code:

int add( int a, int b ) {
    return a + b;

Not knowing C, you may need someone to explain that int is the integer data type and that declarations in C put the type name before the object being declared, but with this, you should be able to guess that the function call add(1,2) will return 3. Adding comments or writing a page of documentation to this code serves little purpose. Is the following code any easier to read?

int add( int a, int b ) {
    /* function to add two numbers a and b
     * prerequisites: a and b are integers
     * side effects:  none
     * result returned: the integer sum of a and b

    return a + b;

The story is quite different when your program is 5000 lines long. At that point, you can't grasp the whole thing at a glance, and you are unlikely to be able to remember from one day to the next what each part of the program does. When programs get that big, you need documentation even if there is only one programmer, and when there is a team involved, it is even more important.

In summary, this is a course about programming in the large, where up to this point, you have been programming in the small.

A Project:

Projects in past semesters have involved simulation of traffic flow in highway networks, simulation of the behavior of biological neural networks, simulation of digital logic circuits and simulation of an epidemic spreading through a population. Given current events, the latter is still a good subject. The emphasis in the above on simulation is for a historical reason: Object oriented programming has its origins in two areas, one is simulation, the other is operating systems. The language Simula 67 (developed in Scandinavia in the late 1960s) is the origin of terms such as class, object and method, as well as the whole idea of class hierarchies. Some people have even said that Simula 67 was an improvement over most of its successors such as C++ and Java.

In this class, we will do the project in Java. Java remains one of the most widely used languages in the world today, but it is deeply flawed. In fact, it is quite fair to say that Java stinks. The standard Java library is poorly thought out, and all of Java is really an afterthought, a reimplementation of C++ to eliminate many faults of that language, where C++ is C with objects pasted on as an afterthought. The fact is, almost all of the languages we have start out simple and clean, and then grow into monsters as time passes. Learning to live with and do productive work with a monster is important!

Some Work:

For this class, we will use Java -- any object-oriented programming language would suffice, and Java is both in very widespread use and deeply flawed. Some say it is still the most widely used language in industry, yet its flaws are serious. Learning to recognize and live with the reality of those flaws is important.

We will use the Linux command line envoronment. This stinks compared to the integrated development environments you may be used to, but it (and its close cousin, the Microsoft DOS command line) remains extraordinarily important for server-side, cloud software and system administration, so it's a good idea to learn to use it. The initial lab exercises in discussion section walk you through an intro to this environment.

A Public Service Announcement:

The best CoOp internships for the coming summer are already filled, but there are still occasional opportunities. If you are looking for summer jobs, get yourself into the pipeline by contacting both the Business and Liberal Arts placement office and the Engineering placement office.

We can hope that the COVID-19 epidemic might be at least partially under control by next summer, but I expect most interviews arranged through the placement offices will be by Zoom or similar technologies.

CS students are welcome in both placement offices because the compaines that recruit through those offices want it that way. Recruiting season for spring graduates traditionally peaks in the fall. COVID-19 may change this, but if you are graduating this spring, and your résumé is not ready to distribute, that should be a major priority.