C-coding-stds-1 - EE312 C Coding Standards 2010 Writing...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
EE312 C Coding Standards – 2010 Writing code that is easy for others (or you later) to read is an important part of programming. Style entails a program's readability and logic structuring. Style is almost as important as correctness in programming. This is useful for you, the programmer, when you are writing code and the graders for reading and making sense of a program. Also, in industry and real-world situations, you usually do not write a whole program at once, nor do you only look at programs you wrote. Usually industry programmers are looking at code they did not write or wrote a long time ago, which is where style and comments become very important to understanding programs. This set of standards has been presented for C programming style. Among the most important points are: 1. The proper use of white space and comments so that the structure of the program is evident from the layout of the code. The use of simple expressions, statements, and functions so that they may be understood easily. 2. Many style choices are arbitrary. Having a style that is consistent (particularly with group standards) is more important than following absolute style rules. Mixing styles is worse than using any single bad style. 3. As with any standard, it must be followed if it is to be useful. If you have trouble following any of these standards don't just ignore them. Talk with your TA or Professor. Here are the style rules for this course. Your program will be graded on conformance with these rules. ANSI Standard C (aka C89) Modern C compilers support at least all of ANSI Standard C. Unless otherwise directed, you are to write code to run under Standard C89. Standard C improves portability by insuring that all compilers accept the same input language and by providing mechanisms that try to hide machine dependencies or emit warnings about code that may be machine-dependent. Program Files The order of sections for a program file (e.g. a .c file) is as follows: 1. First in the file is a prologue that tells what is in that file. A description of the purpose of the objects in the files (whether they be functions, external data declarations or definitions, or something else) is more
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

C-coding-stds-1 - EE312 C Coding Standards 2010 Writing...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online