Style - ENG101 Programming Style Reference: Version 1.0...

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

View Full Document Right Arrow Icon
ENG101 Programming Style Reference: Version 1.0 This programming style guide is a set of mandatory requirements for C++ code layout. These stylistic “laws” are not made for arbitrary reasons. Experience teaches us that conforming to this style, more or less standard through the industry with few exceptions, makes code easy to maintain and allows it to be read less painfully by others. This style guide is mandatory for ENG101, and can only be relaxed under speciFc instructions from GSIs and Profs. This style guide is summarized by example: Indent 3 spaces relative to the preceding for every new nesting level. Curly brackets must always align vertically. Example, int main(void) { int i = 0, k = 1; if (i < k) { int temp = i; i=k; k = temp; if (0 == k) { i = i*i; k = -i; } } return 0; } Variable and function names are in lowercase, terse but descriptive, enough information conveyed within the programming context, with capital letters to start new words internal to the identiFer. Example, numStuds = 211; degToRad = 180/PI; Don’t over do it! Bad example,
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 / 4

Style - ENG101 Programming Style Reference: Version 1.0...

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