[UMN logo]

CSCI 5161: Introduction to Compilers
Spring 2023, University of Minnesota
Some Comments on Coding Standards and Style

The quality of code and its readability are not dispensible aspects in this course. We may assign 50% or more of the grade to these attributes in particular instances. What is more, readability and clarity of code may allow us to find simple mistakes when we look at it and grade it. This would allow us to give you significant credit for a program that is non-functional but could be working with a few small changes. Note also that the code you write in this course will grow gradually through the term and our finding bugs in earlier parts could help you avoid wasting time later on when such bugs could cause other more difficult parts to break unexpectedly. Life is too short for anyone to be wasting time on inscrutable code. You should not be wanting to do this and you should certainly not expect the instructor or the teaching assistant to do this either.

Here are some simple things to bear in mind about your programs; this is not an exhaustive list. There will be some comments specifically about ML style in the lectures and, in any case, we are expecting that you have had lessons before this course on what does and does not constitute good code.

An important point to remember as you work on the compiler: writing good code to solve complicated problems is an activity that has a mathematical character and, like any good mathematics, needs you to think about structure carefully. Resist the temptation to start slapping down code with the idea that you will figure out later how to get things to fit together and actually work. Leave this bizarre style and its advocacy to people who do not really understand what it takes to write good programs.

Last modified: Jan 7, 2023 by ngopalan atsign umn dot edu.

The views and opinions expressed in this page are strictly those of the page author(s). The contents of this page have not been reviewed or approved by the University of Minnesota.