Coding Conventions Flashcards

1
Q

explains itself without need for external documentation, like flowcharts, UML diagrams, process flow diagrams, etc.

A

Self documenting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Coding conventions target:

A

How you write statements in the language, organize them into modules, format them in the source files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

reuse as much legacy code as possible

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The project needs to progress as fast as possible

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You have a team working on a project that will extend over a moderately long period of time. Over the course of the project, people will come and go.

A

Motivation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Style of Working

A
  • read many modules, and edit many.
  • They will “factor out” duplicate code
  • few modules will be able to be said to have an author
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

It’s easier to integrate modules that use a common consistent naming
standard

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Comments, 3 types:

A

– File headers
– Function headers
– Explanations of variables and statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Statements:

A

– Organization: files, “modules,” nesting
– Format: spacing and alignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Divide each module into a public part and a private part.

A
  • public part goes into an include (.h) file
    – private part goes into a source (.c) file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Comments provide _____ information about the program

A

meta

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Commenting _______ is an especially good thing to do.

A

interfaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

don’t need to be commented heavily if their interfaces are well documented.

A

Implementations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Use simple, descriptive variable names.

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

how many levels is enough for major nesting?

A

3 levels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly