Validating multiple choice test items

The aim is to help C programmers to write simpler, more efficient, more maintainable code. We do not suffer the delusion that every one of these rules can be effectively applied to every code base. However, we do believe that a program that uses a rule is less error-prone and more maintainable than one that does not.

Often, rules also lead to faster/easier initial development.

Top In: Introduction P: Philosophy I: Interfaces F: Functions C: Classes and class hierarchies Enum: Enumerations R: Resource management ES: Expressions and statements Per: Performance CP: Concurrency E: Error handling Con: Constants and immutability T: Templates and generic programming CPL: C-style programming SF: Source files SL: The Standard library A: Architectural Ideas N: Non-Rules and myths RF: References Pro: Profiles GSL: Guideline support library NL: Naming and layout FAQ: Frequently asked questions Appendix A: Libraries Appendix B: Modernizing code Appendix C: Discussion Appendix D: Tools support Glossary To-do: Unclassified proto-rules This is a living document under continuous improvement.

Had it been an open-source (code) project, this would have been release 0.8.

As far as we can tell, these rules lead to code that performs as well or better than older, more conventional techniques; they are meant to follow the zero-overhead principle (“what you don’t use, you don’t pay for” or “when you use an abstraction mechanism appropriately, you get at least as good performance as if you had handcoded using lower-level language constructs”).

Consider these rules ideals for new code, opportunities to exploit when working on older code, and try to approximate these ideals as closely as feasible.

Many of the rules are designed to be supported by an analysis tool.

We encourage the development of such more specific rules as addenda to these core guidelines.

Build your ideal small foundation library and use that, rather than lowering your level of programming to glorified assembly code. Some rules aim to increase various forms of safety while others aim to reduce the likelihood of accidents, many do both.

They do not simply define a subset of C to be used (for reliability, safety, performance, or whatever).

Instead, they strongly recommend the use of a few simple “extensions” (library components) that make the use of the most error-prone features of C redundant, so that they can be banned (in our set of rules).

Leave a Reply