CSC 270
Survey of Programming Languages

Instructor: Dr. Stephen Bloch

Fall, 2010

This course meets from 12:15-1:30 on Tuesdays and Thursdays in Science 227.
The last time I taught this course was Fall 2009.

Syllabus Calendar Grading Assignments PSP Moodle course Examples Daily Survey


Throughout the semester (ideally every few days), I'd like you to fill out the daily survey to help me keep track of what people are finding easy, and what people are having trouble with. This can also be used as an anonymous "suggestion box".

Getting Help

My office hours (in my new office, Post 203; if I'm not there, look in the computer lab in Post 102) are Mondays 12:00-3:00, TTh 11:00-12:00, and Wednesdays 9:00-1:00.

Who should take this course?

This course is intended primarily for students majoring or minoring in computer science or information systems. It assumes CSC 171 and 172 as prerequisites. If you're taking 172 concurrently with 270, you'll have a more difficult time, but you should be able to survive the course; talk to the instructor.

Subject matter

There are more details in the syllabus, but in brief, we'll learn bits of three languages --- Scheme, C++, and Prolog --- that are new to most of you. We'll do simple exercises in each language to make sure we understand the basics, then do a a few more substantial programs in each language. And for more of an "under the hood" view, we'll write interpreters for some very simple languages, so we can see some of the subtleties involved in implementing a language.

In all languages, you will be expected to follow good general programming practices: give meaningful names for variables, types, and functions; use named constants for "magic numbers" that appear more than once in a program; provide test cases for all parts of your program; use white space and indentation as appropriate in the language to enhance readability; segregate I/O from computation as much as possible; write several small functions that do one thing each rather than a single big function that does many things; plan for re-use, modification, and extension; etc. If you're not sure what any of these things means, ask me -- ideally in class, as your classmates probably have the same questions.


Other Reading



There are several Scheme implementations available, but the one most widely-used in education is DrScheme, freely downloadable for Windows, Macintosh, Unix, etc. One of its nice features is language levels: if you're a "Beginning Student", you'll get error messages for certain things that are technically legal in Scheme but which a beginning student doesn't need. If you decide you do need a certain feature, you can promote yourself to "Intermediate Student", "Advanced Student", etc. with a few mouse-clicks. The currently-installed version of DrScheme, by the way, includes not only six pedagogical subsets of Scheme, but four subsets of Java and one of Algol 60....

In June, 2010, the PLT version of Scheme was renamed "Racket", and the DrScheme program was renamed DrRacket. As far as I know, pretty much everything that worked in Scheme last year still works in Racket this year, but we may find some minor incompatibilities.

To get the latest version onto the lab computers,

  1. download this file and unzip it into your F: ("Persistent Storage") drive (this should only need to be done once, unless somebody deletes it).
  2. Then open the "Racket" folder and double-click the "copystuff" script, which will copy some stuff from the F: drive onto the C: drive (this needs to be done every time the computer is rebooted, since that wipes the C: drive).

Some of the Scheme we do will be in the PLAI dialect. How you switch to this dialect depends on your version.

In DrRacket,...
change the #lang racket line to #lang plai .
In DrScheme on a Windows machine in a campus lab:
Download this file, expand it (it doesn't matter where), and open the folder it expands to (which should be named "plai"). Double-click the file "copy-plai.bat" in this folder; it'll copy a bunch of stuff into the right places on your computer. Then run DrScheme, choose the "Language" menu, click the triangle next to "Programming Languages: Application and Interpretation", select "PLAI Scheme", and click "OK".
Macintoshes in campus labs:
Download this file into your Downloads folder, expand it, and open the folder it expands to (which should be named either "plai" or "plai-mac"). Double-click the file "copy-plai" in this folder; it'll copy a bunch of stuff into the right places on your computer. Then run DrScheme, choose the "Language" menu, click the triangle next to "Programming Languages: Application and Interpretation", select "PLAI Scheme", and click "OK".
Your own Macintosh or Windows machine:
You're probably better off downloading the latest version of DrRacket, which makes this easy.

General Development Environments

I recommend Eclipse, a professional-level development environment which is available for free download and has "plug-ins" available to work with several different languages: Java, C, C++, Prolog, etc.

Another possibility is jGRASP, which is designed for first-year programmers and therefore has fewer "professional" bells and whistles, but provides a cute graphical annotation of the control flow of your program. It works best on Java, but it can support C, C++, and Ada as well.

C++ and C

Microsoft Visual C++ may be installed on the Windows machines in the lab, but I don't particularly like it. Eclipse is also installed, as is (I think!) a C/C++ compiler. If you want to use Eclipse for C/C++ programming at home, first install Eclipse; then you'll need a C/C++ compiler. On Windows, see these directions (updated Oct. 15, 2009) to get Eclipse working with the C and C++ compilers. On Mac and Unix, you've already got a C/C++ compiler, so you can use these simpler directions instead.


We'll be using a free implementation of Prolog called "SWI Prolog". It should be installed on the machines in the lab.

Partners for upcoming assignments

If you need a partner for the next homework, please e-mail me immediately and I'll try to match you up with someone.

Software support

I've set up some forms for entering and viewing PSP data. You may use these forms to record defects, time allotted, time spent, and program size, but I won't require this information. To use the forms successfully, make sure your browser accepts JavaScript and cookies. (For those with a moral opposition to cookies, I assure you that they're all "temporary" -- they disappear as soon as you quit the browser.) (For more information about PSP, see the PSP page at Carnegie-Mellon or read Watts Humphrey's Introduction to the Personal Software Process.)

Last modified:
Stephen Bloch /