This paper gives a comprehensive insight into the author's guidelines in C programming. Many aspects that are needed to define these guidelines are thoroughly discussed. The paper provides much background information needed for the decisions about do's and don't's in C coding.
The paper shows the abstractions and considerations that lead to recommendations in C programming. It is the author's opinion that all the coding recommendations can be deduced from general coding aims.
Aim of coding
Obviously one first aim of coding is to implement functionality in form of software components. First of all, the implementations should fulfill the following goals:
• error free design (which is sometimes only proven in the implementation phase)
• error free algorithms
• error free code architecture (what is to be known as bugfree1)
Note that software defects can be a security problem2.
Then, software engineering aims are
• maintainability (ease of expanding or correcting code)
• reusability
The importance3 of the software engineering issues mainly depends on the overall size of a project. If you intend to expand the project or to convert parts of it into a (reusable) software library, software engineering issues should be considered from start on.
We can say that the smaller the project, the more likely it is manageable without considering software engineering issues. However, if your design and coding experience allows, I recommend not to neglect software engineering issues even with the smallest projects, since
• a project may (later) expand to a much larger size
• projects code fragments may become part of a software library
Aim of this paper
The intention of this paper is to summarize considerations made about fulfilling the above coding aims and making C code
• less defective
• more robust (against changes in code architecture)
• more readable4 (for easier maintenance)
Apart from considerations and background information, some recommendations will be given5.
Design issues are not so much covered in this paper, since they are often independent of the programming language.
This paper won't compare the C programming language to other programming languages. Some aspects, like efficiency and economy of a programming language depend heavily on a programming environment's implementation6. Other aspects, like reliability (e.g. through pre- and postconditions) can be seen in the C language as part of the design rather than coding.
However, a few footnotes are included about better approaches of the C++ language in (not object orientated) language details.
Friday, January 9, 2009
Introduction
Posted by abhilash at 8:41 AM
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment