Send
Close Add comments:
(status displays here)
Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Program style guidelines
1. Program style guidelines
Program style is very important.
2. Screen lines
As programs get longer, a limiting factor in seeing what is happening in a program is the amount of visible lines on the screen.
Modern computer systems allow monitors to be in portrait orientation rather than landscape mode. I like some of my monitors to be in portrait mode to get about 80 lines of visible text rather than, say, 50 lines.
There are ways to make use of the available lines.
3. Blank lines
Using blank lines is a good way to group or chunk parts of a program.
Do not use more than one blank line at a time. The extra space does little to help separate and reduces the number of available screen lines.
4. Braces
The brace style used can help make better use of available screen lines. Consider the following.
int main(void) {
// code
}
The following brace style uses one additional line. Given that braces are used a lot, on a screen of 50 lines, 5 lines, or 10%, may be unnecessarily used.
int main(void)
{
// body
}
5. End of page