This course meets from 9:25-10:40 AM on Tuesdays and Thursdays
in Science 227.
The last time I taught this course was Fall 2010. A lot of this page is copied from last year; I'll make updates as I get to them.
|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".
My office hours (in Post 203; if I'm not there, look in the computer lab in Post 102) are MTWTh 3:00-4:00 and W 9:30-1:00.
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.
There are more details in the syllabus, but in brief, we'll learn bits of three languages --- Racket, Prolog, and Ruby --- 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.
Felleisen et al's How to Design Programs. This is a textbook for beginning programming, which happens to use Scheme (closely related to Racket). Since you know the basic concepts of programming already, you should be able to skip through those parts quickly and concentrate on learning the language.
For this purpose, I recommend starting with the incomplete second edition. Chapter 1 will get you very quickly through the Racket syntax for function calls, variable definitions, function definitions, conditionals, and even a bit of GUI programming. Chapter 2 revisits these topics in more detail, and discusses the step-by-step process of designing and developing a program, as well as "structures" (classes with fields) and polymorphism. Chapter 4 (chapter 3 hasn't been written yet!) covers lists and recursion, which are both easier in Racket than in Java. After that, we run out of Second Edition, but the complete 2001 edition of the book is at www.htdp.org.
My Racket-based textbook Picturing Programs, also free on-line. (You can also buy a printed copy for about $30, if you wish.)
Shriram Krishnamurthi's Programming Languages: Application and Interpretation. This is intended as a textbook on programming language implementation, for upper-level undergraduate or beginning graduate students. We'll do a few chapters of it this semester, and more next semester in CSC 272. This book, too, is free on-line (although you can order a printed copy if you want).
The Amzi Prolog Tutorial, also free on-line.
On-line materials for Ruby. You'll probably want to start with the Ruby web site If you're a member of ACM, you can also use the Ruby Learning Path, as well as the ACM's books24x7 collection of on-line books. More materials to come as I discover them :-)
There are several Scheme implementations available, but the one most widely-used in education is DrRacket, 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 Racket 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.
Some of the Racket we do will be in the PLAI dialect. To switch to this dialect in DrRacket,
#lang racketline at the top of the Definitions pane to
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.
We'll be using a free implementation of Prolog called "SWI Prolog". It should be installed on the machines in the lab.