Let's look at a simple memo pad application. Try
What else might this program do? What other tests might we run?
What functions do you suppose make up this app? What data structures do you suppose are being used? If you were writing this in Python or Ada, what parts would it have?
What additions or changes could we make to this program?
What else might you add or change? What effects would those additions or changes have on the existing code? Are there ways we could organize the code to localize certain kinds of changes?
We are moving toward object-oriented programming.
Welcome to CS 2530 Intermediate Computing. This course completes the department's three-course introductory programming sequence. Its primary goal is to introduce you to ideas and tools for programming "in the large"... (add detail).
We have much to learn:
Notice that I say "You will learn...", not "I will teach you...". Now that you have a year of programming and at least one language under your belt, we will begin to turn more of the task of learning new things over to you. That's a good thing. Once you graduate, you will be in charge of your own learning. And in computing, you need to learn new things all the time.
That said, I will do as much as I can to help you learn.
This course is incredibly cool, because you have a chance to delve much deeper into programming and learn how to write more complex and more flexible programs. Objects will be our tool for doing that.
Take a look at the course syllabus. Like all other course materials, it is on-line at the course web page:
In class, I briefly introduced some of the information you will find there, including ways to contact me, sources of course material, the textbooks, grading details, and the like. In particular, on the computing environment: running Java at home, accounts on student.cs.uni.edu, submission system with CatId.
Well, not really. I won't record you grade.
Write a program that repeatedly reads in integers, until it reads the integer -1. After seeing -1, it should print the average of the integers and terminate.
Why did I ask you to do this? It is a basic CS1 program, something you learn to write in Week 4 or Week 5. So it's a good test of whether you remember the language, or how to program more generally.
I will use what I see to prepare the rest of the course, taking into account that most students at most schools don't do as well as they -- or their professors -- would like.
Look at the memo pad directory. A number of files. Functions/procedures/methods grouped by the data they manipulate.
This semester, we will read a lot of code. Some of it will be more advanced than you can write at the time. Reading code is a great way to learn a language or a programming style.
We can compile and run a program in a couple of different ways. If we use an integrated development environment such as Dr. Java, then we may just press a Compile button or a Run button. Great support, but good to know a little deeper...
Big lesson 1: Computer scientists understand the tools they use.
If we develop our programs from the command line using standard tools such as a text editor and a compiler, then we will enter one or more commands. For example:
mac os x > emacs MemoPadApp.java # or vim or ... mac os x > javac MemoPadApp.java mac os x > java MemoPad
This semester, we will ask you to step away from an IDE and even from the Windows, if that has been your operating system of choice. We'll help you to learn the command line tools on your preferred Unix system (Linux, or perhaps Mac OS X). As a computer scientist, you need to know how to work at the level of the operating system, and this is a great way to begin learning.
To help me help you learn, I need some information about the class. Please answer the following questions. You may speak anonymously, if you wish.
OOP has its own vocabulary. Java does, too. We will learn a lot of it this semester, beginning soon.
One of the creators of object-oriented programming was Kristen Nygaard. He and his colleague Ole Johann Dahl created what is generally considered the first OO language, Simula, in the 1960s. The central theme running through all of Nygaard's work is this syllogism:
Let's begin to understand.
Write down at least three questions you have about this code. At this point, focus on the actual programs themselves, not philosophical questions about Java or OOP.