Coding Standards and Style Guidelines


General Rules

Your program probably meets these coding standards if you can call up your customer or another programmer on your project, read your subroutine (over the phone) to that individual, and have the person understand the following three things,: what the program does, how it does it, and where the required information comes from.

Most of the work here is at least inspired by Donald Knuth's landmark 1984 work Literate Programming.  It continues to be influence by the kind of work exemplified by the Literate Programming site.

Naming Convention

If you think that Microsoft's official naming convention adds all of the intelligibility to your programs that Pig Latin adds to English, you might want to take a look at this perspective. Write code that your customers can understand and you can afford to maintain.

Module Layout

It's as simple as it can get. You may love what's not there.

Proper Use of Comments

The short story is that comments are no replacement for readable, understandable code. Unfortunately, we can't always make the code express rationale.

Error Handling

Error Handling is more than a sneaky way to force you to use a GoTo construct. It's where the programmer builds a fallback defense for completely unexpected events.