Welcome to CS 5!
 
The grand design

One might consider a goal of higher education to be an invitation to think in new and unfamiliar ways. In that vein, this course is an invitation to think about problems from a computational point of view, i.e., from a computer's perspective.

It isn't hard to argue that thinking about things from a computer's perspective is a useful skill nowadays. Regardless of the current financial state of the tech sector, computers play a sizable role in business, education, entertainment, and everyday life. Just as interpersonal interactions benefit from as much mutual understanding as possible, so do the inevitable interactions with computing devices benefit from a sense of shared context. And, though I'm someone who thinks the possibility of computers learning how we think is an intriguing possibility, for the moment, that burden rests on our shoulders. Whatever you pursue, I believe an understanding of how machines think will be a valuable tool along the way.

An excellent way to get a feel for how machines think is to program them in a general-purpose language. Everyone in CS 5 will use a large number of special-purpose langauges in their academic careers and beyond -- simply reading this page likely involves some interaction with HTML, the hypertext markup language used in the majority of web content. Underlying the web, all of Microsoft's products, Matlab, Labview, and any other interaction with computing machines are general-purpose languages that expose the full power (and all of the limitations) of today's hardware. This class will focus on the Java programming language.

About the course text

The on-line text we use for CS 5 is available here. It was written by David J. Eck of Hobart and William Smith colleges in Geneva, NY. It has a full year's worth of material on programming and java. As a result, we will be using selected portions of the text in CS 5. Other sections will be marked as optional -- feel free to pursue these as your interest and time permit. This book is provided from Harvey Mudd's servers according to its "copyleft" licence. The entire text is available from Hobart and William Smith from this link, which includes additional links for downloading and searching the book.

About java's input/output facilities

Because java has, well, idiosyncratic support for text input and output, almost all courses that teach programming with java use their own input/output packages. In Harvey Mudd's CS 5, we use the H package, which is documented here. However, at Hobart and William Smith Colleges, they use a package called TextIO. Because TextIO appears throughout this text, here is a table of "translations" between the two packages. Remember that where you may see things in the left-hand column in the text, you'll want to use the equivalents in the right-hand column in your code. (You'll notice my dedication to minimizing typing in the Harvey Mudd versions!)

Equivalents between H (what we use) and TextIO (what the text uses):

H TextIO Description
Output
H.p(...) TextIO.put prints without a final newline character
H.pl(...) TextIO.putln prints with a final newline character
Input
H.nl() TextIO.getln gets a line of text from the user
H.nw() TextIO.getWord
TextIO.getlnWord
gets a word from the user (up to a space)
H.ni() TextIO.getInt
TextIO.getlnInt
gets an integer from the user
H.nd() TextIO.getDouble
TextIO.getlnDouble
gets a double from the user
H.nc() TextIO.getChar
TextIO.getlnChar
gets a non-whitespace char from the user
H.nanyc() TextIO.getAnyChar gets any char (good for "hit enter to continue" pauses)