Navigate This Site...

General Coding Conventions

This document attempts to outline the coding conventions used currently by myself, and is intended to serve as a guideline for anyone wishing to contribute code back to the projects hosted on this website. These guidelines will help ensure that everybody can read and understand the software hosted here.

These guidelines were developed over several years of working with several different languages, independent of other styles of programming. I was shocked to find that Kent Beck's Smalltalk style mirrors my own very closely. In fact, the fact that I can't seem to find his Smalltalk style guide on the Internet anymore is what provided the inspiration to post my own guide.

The rules of thumb listed herein is applicable to all languages, and I use these with languages as diverse as Forth to C to Python to even assembly language.

Variables

Functions and Methods

Types

Miscellaneous

Violations to Law of Demeter

For performance critical code, you should still follow Law of Demeter for development purposes, and then inline knowledge and behaviors as appropriate just enough to meet performance requirements.