< previous page page_7 next page >

Page 7
1.5
Objectives and Priorities
1.5.1
Correctness
The first priority for the code in this book is that it should work correctly. No other consideration matters if the code is wrong.
1.5.2
Legibility
The code should be readable. Readable code is simple and understandable code, which is a long step toward correct and maintainable code.
This lesson has been lost in the design, and much of the use, of the C language. It is a priority here, and the style and conventions followed in this book reflect that priority.
1.5.3
Portability
The code is portable, as far as possible. A small number of routines is specifically designed for the PC, simply because this machine is the most common computer in the world today, and a great deal of C code is written for it. In general, I adhere to ANSI and/or ISO standards, except in specific cases, such as PC-specific code.
1.5.4
Speed and Efficiency
Code speed and efficiency are always considerations and receive attention when they do not directly conflict with the more important objectives. In the SCDTL philosophy, major speed problems arise from the choice of a bad design, and major improvements in speed do not come with bit-twiddling tweaks. Simple, clean, and legible design is generally good design.
1.6
Coding Style and Conventions
This section describes the coding style used in SCDTL and outlines the important conventions employed.
1.6.1
Function Name Conventions
Functions that do a certain kind of thing and belong to a group of related functions have similar names throughout the SCDTL system. Functions that create data structures, for example, start with the word '"make," and format functions start with the word "format."

 
< previous page page_7 next page >