Embedded Systems Building Blocks, Second Edition

Conventions should be established early in a project. These conventions are necessary to maintain consistency throughout the project. Adopting conventions increases productivity and simplifies project maintenance. A few years ago, I saw an article in the Hewlett-Packard Journal (see Bibliography on page 585) about the processes used by a team of engineers to design the HP54720/10 oscilloscope. One of the aspects of the design consisted of developing a coding convention. "A consistent format made the code much easier to read and understand. At the completion of the project, all of the engineers involved were enthusiastic about using the standard in developing the code". If you are serious about improving your programming skills you should get Code Complete by Steve McConnell (see Bibliography on page 585). Steve also highly recommends that you adopt a coding convention before you begin programming. As he says, "It's nearly impossible to change code to match your conventions after the code is written".
In this section I will describe the conventions I have used to develop the software presented in this book.
Adopting a consistent directory structure avoids confusion when either more than one programmer is involved in a project, or you are involved in many projects. This section shows the directory structure that I use on a daily basis.
All software development projects are placed in a \PRODUCTS subdirectory from the root directory. I prefer to create the \PRODUCTS subdirectory because it avoids having a large number of directories in the root...