Maintaining Ugly Code

This exercise was conceived as a way to show students the importance of good programming style by making them deal directly with the problems created by poorly-written code.

Things you can download

The Ugly Program as a PDF
Here is a formatted, pretty-printed version of the program.
The Ugly Program as Plain Text
This is a program which compiles and works correctly. It reads its input and prints out the character which occurs most frequently.
Maintaining Ugly Code Handout
This is the handout which explains the assignment.
Maintaining Ugly Code Poster
This is the faculty poster which was presented at SIGCSE.

Several files on this page are in Adobe's Portable Document Format. Some systems come with programs which can read PDF files; if yours did not, you can almost certainly find a version of Adobe Acrobat which will work on your machine.

Get Adobe Acrobat This link will take you to Adobe's page for Acrobat. You probably want to click on the "Adobe Reader" link, and then look under "Downloads" for "Free Adobe Reader".