Computer Science 171

Introduction to Computer Programming

Spring 2006

Dr. Stephen Bloch
office 113A Alumnæ Hall
phone 877-4483
Web page
Class Web page
office hours Mondays 4-5, Tuesdays 10-4, or by appointment

January 24, 2006

If you want a nicely-printed copy of this syllabus, see this Postscript version.

1  Subject Matter  -- Overview

Computers do many of the same things people do, only faster, more accurately, and without getting bored. Accordingly, the task of programming a computer is essentially the task of figuring out exactly how you would solve a particular problem, and then explaining it to the computer. Unfortunately, computers are literal-minded and completely devoid of intuition, so your explanation must be much more precise and unambiguous than if you were explaining things to a human being. This course, therefore, is about how to figure out precisely and unambiguously what problem you're trying to solve, figure out precisely and unambiguously how to solve it, and explain all this to a computer.


2  Who Should Take This Course

If you're a CS or CMIS major, you should take this course as early as possible, preferably in your first or second semester at Adelphi. If you're a CS minor or a math major, you should take this course in your first two years at Adelphi. If you're a math major, you're required to take a semester of programming; you may choose either this course or the somewhat less-intense CSC 160 "Computer Programming for Non-Majors"; consult with the professor. If you're planning on any other major but are curious about how computer programs and programmers work, you are welcome to take this course, but you might be better served by CSC 160; again, consult with the professor. If you have no interest in writing programs of your own, but simply want to use Web browsers and search engines, spreadsheets, databases, word processors, etc. and perhaps write your own Web pages, you should take CSC 170 instead.

This course does not assume that you've ever written a computer program before, but even if you have, you'll probably learn new ideas here. This is a 4-credit course: 3 hours/week of lecture and 3 hours/week of lab. The usual rule of thumb for out-of-class work is twice the lecture time, so you should plan on spending an additional 6 hours/week on reading and homework. In particular, you'll need to read, on average, around 40 pages a week, and the programming homework will take a significant amount of time. I'm not kidding.

3  Goals of the Course

By the end of this course, you should

Naturally, you will continue learning many of these skills throughout your computer science career, but you should make a good start on all of them this semester.

4  Subject Matter  -- More Details

4.1  "Good" Programs

What distinguises a "good program" from a "bad program"? Obviously, a good program has to work correctly and reliably  -- a difficult goal in itself, as we'll see. But this is far from enough. In practice, very few programs are written once, used for a while, and discarded: much more often, a program is used until the need for it changes, the program is modified (often by a different programmer) to handle the new requirements, the modified program is used for a while, and the cycle repeats. Thus a "good program" must be not only correct the first time around, but structured in such a way that it can easily be modified to accomodate likely changes in requirements. To get across the point of modifiability, I may occasionally change the assignment slightly on the day that it's due. So whenever you get an assignment, you should immediately start thinking "how is Dr. Bloch likely to change this at the last minute?" and prepare for such a change. If implementing the change takes you an hour or more, you didn't design the program well for modifiability.

There are other criteria for a "good" program, in addition to correctness and modifiability: fault-tolerance, efficiency, user-friendliness, etc. You'll learn more about these in subsequent computer science courses.

4.2  Kinds of Knowledge


  1. How to use the computers and the software on them






4.3  Language and design recipes


One way to avoid wasting time on level-1 and level-2 issues is to use a simple language and development environment. We'll start this semester in the Scheme programming language, because it's simple, consistent, and powerful; some time in March, we'll switch to the more popular but more complicated Java language and see how to do the same things in it. Throughout the semester, we'll use development environments, DrScheme and ProfessorJ, designed for teaching beginning programmers; these are downloadable for free at


5  Texts

For the Scheme portion of the course, we'll use the textbook How to Design Programs by Felleisen, Findler, Flatt, and Krishnamurthi (MIT Press, ISBN 0-262-06218-6). You don't have to buy it  -- it's on the Web for free at -- but I've ordered it through the bookstore for those who prefer a printed book.

For the Java portion of the course, we'll probably use the sequel textbook How to Design Class Hierarchies, which isn't in print yet; your reactions to it will affect how it looks when it comes out in a few months.

For more level-4 knowledge, we'll use Introduction to the Personal Software Process, by Watts Humphrey (Addison-Wesley 1996, ISBN 0-201-54809-7). This book discusses how to keep track of problems you encounter in programming, so as to prevent them in the future, and how to manage your time so as to finish programming assignments before they're due. (The easiest way to fail my class is to fail to turn in homework assignments!) Some of the record-keeping forms in the book are a little overly complex for a first course, so I've put up simplified, Web-based versions. There will be no specific assignments from this book, but I recommend reading it and practicing its advice anyway. It's a cheap paperback.

I've also arranged to use an on-line tutoring system called CodeLab, which provides a bunch of very short programming exercises that you can have graded automatically (so you don't have to wait for me); when you get something wrong, you can figure out why, fix it, and re-submit as many times as you like. After you first sign in, you can try the system for free for ten days, after which (if you're still in the class) you'll need to pay $25 to continue using it. If you're not sure you're going to stay in the class, I recommend not signing into CodeLab until we get to the Java part of the course, so you have your full ten days to try it.


6  Grading

Your grade will be computed from several sources:


7  Program standards





8  Ethics


Most homework assignments in this course involve writing, testing, and debugging one or more programs. Some of these programs are to be written individually; for others, you are to work in teams of two students, switching teams from one assignment to the next, if at all possible. (If you have a really terrible schedule and can't get together with a partner, talk to me and we'll arrange something.)





9  Schedule

This class meets for lecture every Monday, Wednesday, and Friday from 10:00-10:50 in Science 321, and for lab every Monday and Wednesday from 2:25-3:40 in Science 227.


I expect you to have read the reading assignments (an average of 15 pages per lecture) before the lecture that deals with that topic. This way I can concentrate my time on answering questions and clarifying subtle or difficult points in the textbook, rather than on reading the textbook to you, which will bore both of us. Please read ahead!


Last modified: Tuesday, January 24th, 2006 3:41:39pm