The Psychology of Quality and More |
CHAPTER 3 : General Principles
3.5 Be consistentChanging the way things are done is a certain way to cause confusion in the reader, and could lead to serious error. When a style is chosen, it must be used consistently. Depending on the level of agreement that can be achieved within an organization, the scope of usage of the standards may vary significantly. At the very least, even if there are no standards, code in one function should be consistent. The result of total inconsistency can be very confusing, as the following example of inconsistent naming, bracing and parenthesizing illustrates:
if ( WndHt < WIN_MIN) <-----------------------------------------------> The consistency principle applies to all elements of style, including naming, commenting, layout and usage. It should also be applied to the selection of standards. If, for example, one brace style is selected, then the same style should be used for both code blocks and declarations (including struct's, union's and enum's).
|
Site Menu |
Quality: | Quality Toolbook | Tools of the Trade | Improvement Encyclopedia | Quality Articles | Being Creative | Being Persuasive | |
And: | C Style (Book) | Stories | Articles | Bookstore | My Photos | About | Contact | |
Settings: | Computer layout | Mobile layout | Small font | Medium font | Large font | Translate | |
You can buy books here |
And the big |