Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin Series)
Rate it:
Open Preview
73%
Flag icon
Look for every boundary condition and write a test for it.
73%
Flag icon
Every time you see duplication in the code, it represents a missed opportunity for abstraction.
74%
Flag icon
Variables and function should be defined close to where they are used.
74%
Flag icon
The methods of a class should be interested in the variables and functions of the class they belong to, and not the variables and functions of other classes.
74%
Flag icon
Sometimes, however, Feature Envy is a necessary evil.
74%
Flag icon
Selector arguments are just a lazy way to avoid splitting a large function into several smaller functions.
74%
Flag icon
In general it is better to have many functions than to pass some code into a function to select the behavior.
74%
Flag icon
One of the most important decisions a software developer can make is where to put code.
74%
Flag icon
Code should be placed where a reader would naturally expect it to be.
75%
Flag icon
In general you should prefer nonstatic methods to static methods.
75%
Flag icon
More explanatory variables are generally better than fewer.
75%
Flag icon
Being unsure what your code does is just laziness.
76%
Flag icon
In general it is a bad idea to have raw numbers in your code. You should hide them behind well-named constants.
76%
Flag icon
There are some formulae in which constants are simply better written as raw numbers.
76%
Flag icon
Extract functions that explain the intent of the conditional.
76%
Flag icon
Temporal couplings are often necessary, but you should not hide the coupling.
77%
Flag icon
Public classes that are not utilities of some other class should not be scoped inside another class.
77%
Flag icon
Separating levels of abstraction is one of the most important functions of refactoring, and it’s one of the hardest to do well.
78%
Flag icon
Names are too important to treat carelessly.
79%
Flag icon
The power of carefully chosen names is that they overload the structure of the code with description.
79%
Flag icon
The length of a name should be related to the length of the scope.
79%
Flag icon
The tests are insufficient so long as there are conditions that have not been explored by the tests or calculations that have not been validated.
79%
Flag icon
Sometimes you can diagnose a problem by finding patterns in the way the test cases fail.
81%
Flag icon
We can define an atomic operation as any operation that is uninterruptable.
82%
Flag icon
A Callable looks like a Runnable, but it can return a result, which is a common need in multithreaded solutions.
82%
Flag icon
The synchronized keyword always acquires a lock, even when a second thread is not trying to update the same value.
84%
Flag icon
It is always better to synchronize as little as possible as opposed to synchronizing as much as possible.
84%
Flag icon
To really solve the problem of deadlock, we need to understand what causes it.
85%
Flag icon
One thread cannot take resources away from another thread.
85%
Flag icon
The most insidious problems are the ones that have such a small cross section that they only occur once in a billion opportunities.
1 2 3 5 Next »