Code Complete
Rate it:
Open Preview
Started reading November 29, 2024
15%
Flag icon
The process of distilling abstract concepts from real-world entities is non-deterministic, and different designers will abstract out different generalities.
16%
Flag icon
If you're passing a parameter among several routines, that might indicate a need to factor those routines into a class that share the parameter as object data.
16%
Flag icon
A class that has only behavior but no data is generally not really a class.
16%
Flag icon
The routine makes modern programming possible.
17%
Flag icon
Some verbs are elastic, stretched to cover just about any meaning.
17%
Flag icon
To name a function, use a description of the return value. A
17%
Flag icon
To name a procedure, use a strong verb followed by an object. A
17%
Flag icon
In object-oriented languages, you don't need to include the name of the object in the procedure name because the object itself is included in the call.
18%
Flag icon
If you pass a parameter to a routine, use it.
18%
Flag icon
Put status or error variables last. By
18%
Flag icon
Assigning the input value to a working variable emphasizes where the value comes from.
18%
Flag icon
If you are passing the same data to many different routines, group the routines into a class and treat the frequently used data as class data.
18%
Flag icon
Actual parameters are the variables, constants, or expressions used in the actual routine calls.
18%
Flag icon
If the anticipated performance gain doesn't justify the bother of profiling the code to verify the improvement, it doesn't justify the erosion in code quality either.
19%
Flag icon
Does the routine's parameter list, taken as a whole, present a consistent interface abstraction?
19%
Flag icon
Does the routine avoid using input parameters as working variables?
19%
Flag icon
In defensive programming, the main idea is that if a routine is passed bad data, it won't be hurt, even if the bad data is another routine's fault.
19%
Flag icon
Assertions check for conditions that should never occur.
19%
Flag icon
Assertions are used to handle errors that should never occur in the code.
20%
Flag icon
Robustness means always trying to do something that will allow the software to keep operating, even if that leads to results that are inaccurate sometimes.
20%
Flag icon
Exceptions are a specific means by which code can pass along errors or exceptional events to the code that called it.
20%
Flag icon
Exceptions weaken encapsulation by requiring the code that calls a routine to know which exceptions might be thrown inside the code that's called.
20%
Flag icon
Don't throw an uncaught exception in a section of code if you can handle the error locally.
20%
Flag icon
Defining some parts of the software that work with dirty data and some that work with clean data can be an effective way to relieve the majority of the code of the responsibility for checking for bad data
20%
Flag icon
Convert input data to the proper form as soon as possible after it's input.
20%
Flag icon
Completely fill any memory allocated so that you can detect memory allocation errors.
21%
Flag icon
Are all exceptions at the appropriate levels of abstraction for the routines that throw them?
21%
Flag icon
Describe the meaning of the approach rather than how the approach will be implemented in the target language.
22%
Flag icon
If you have trouble creating a good name, that usually indicates that the purpose of the routine isn't clear.
22%
Flag icon
Understand the role of each line of code and why it's needed.
23%
Flag icon
If you find yourself staring at the computer screen not knowing where to start, that's a surefire sign that the PPP would make your programming life easier.
23%
Flag icon
Have you defined the problem that the class will solve?
23%
Flag icon
Have you designed each routine by using detailed pseudocode?
1 2 4 Next »