Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin Series)
Rate it:
Open Preview
Kindle Notes & Highlights
44%
Flag icon
High class and method counts are sometimes the result of pointless dogmatism.
45%
Flag icon
Concurrency is a decoupling strategy. It helps us decouple what gets done from when it gets done.
45%
Flag icon
Recommendation: Keep your concurrency-related code separate from other code.6
45%
Flag icon
Recommendation: Take data encapsulation to heart; severely limit the access of any data that may be shared.
45%
Flag icon
Recommendation: Attempt to partition data into independent subsets than can be operated on by independent threads, possibly in different processors.
46%
Flag icon
Recommendation: Think about shut-down early and get it working early. It’s going to take longer than you expect. Review existing algorithms because this is probably harder than you think.
46%
Flag icon
Recommendation: Write tests that have the potential to expose problems and then run them frequently, with different programatic configurations and system configurations and load. If tests ever fail, track down the failure. Don’t ignore a failure just because the tests pass on a subsequent run.
46%
Flag icon
Most developers do not have an intuitive feel for how threading interacts with other code (authors included).
46%
Flag icon
Recommendation: Do not ignore system failures as one-offs.
47%
Flag icon
Multithreaded code behaves differently in different environments.
47%
Flag icon
Recommendation: Use jiggling strategies to ferret out errors.
49%
Flag icon
If we have learned anything over the last couple of decades, it is that programming is a craft more than it is a science.
49%
Flag icon
To write clean code, you must first write dirty code and then clean it.
52%
Flag icon
One of the best ways to ruin a program is to make massive changes to its structure in the name of improvement.
52%
Flag icon
I use the discipline of Test-Driven Development (TDD). One of the central doctrines of this approach is to keep the system running at all times.
63%
Flag icon
Much of good software design is simply about partitioning—creating appropriate places to put different kinds of code.
72%
Flag icon
Commented-out code is an abomination.
73%
Flag icon
Every boundary condition, every corner case, every quirk and exception represents something that can confound an elegant and intuitive algorithm. Don’t rely on your intuition. Look for every boundary condition and write a test for it.
73%
Flag icon
Turning off failing tests and telling yourself you’ll get them to pass later is as bad as pretending your credit cards are free money.
73%
Flag icon
Every time you see duplication in the code, it represents a missed opportunity for abstraction.
73%
Flag icon
We don’t want lower and higher level concepts mixed together.
73%
Flag icon
In general, base classes should know nothing about their derivatives.
73%
Flag icon
Good software developers learn to limit what they expose at the interfaces of their classes and modules.
73%
Flag icon
Hide your data. Hide your utility functions. Hide your constants and your temporaries.
74%
Flag icon
The problem with dead code is that after awhile it starts to smell.
74%
Flag icon
When you find dead code, do the right thing. Give it a decent burial. Delete it from the system.
74%
Flag icon
If you do something a certain way, do all similar things in the same way.
74%
Flag icon
In general an artificial coupling is a coupling between two modules that serves no direct purpose. It is a result of putting a variable, constant, or function in a temporarily convenient, though inappropriate, location. This is lazy and careless.
74%
Flag icon
When a method uses accessors and mutators of some other object to manipulate the data within that object, then it envies the scope of the class of that other object.
74%
Flag icon
All else being equal, we want to eliminate Feature Envy because it exposes the internals of one class to another.
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
Code should be placed where a reader would naturally expect it to be.
75%
Flag icon
It is remarkable how an opaque module can suddenly become transparent simply by breaking the calculations up into well-named intermediate values.
75%
Flag icon
If you have to look at the implementation (or documentation) of the function to know what it does, then you should work to find a better name or rearrange the functionality so that it can be placed in functions with better names.
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
Ambiguities and imprecision in code are either a result of disagreements or laziness. In either case they should be eliminated.
76%
Flag icon
Extract functions that explain the intent of the conditional.
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
it comes down to making sure that modules know only about their immediate collaborators and do not know the navigation map of the whole system.
78%
Flag icon
Don’t use inheritance as a way to cheat the scoping rules of the language. Use a static import instead.
78%
Flag icon
Names in software are 90 percent of what make software readable.
79%
Flag icon
Don’t pick names that communicate implementation; choose names the reflect the level of abstraction of the class or function you are working in.
79%
Flag icon
the longer the scope of the name, the longer and more precise the name should be.
79%
Flag icon
Keep your names free of Hungarian pollution.
79%
Flag icon
A test suite should test everything that could possibly break.
79%
Flag icon
T2: Use a Coverage Tool!
79%
Flag icon
T3: Don’t Skip Trivial Tests
79%
Flag icon
Take special care to test boundary conditions.
79%
Flag icon
Complete test cases, ordered in a reasonable way, expose patterns.
80%
Flag icon
So do what you must to keep your tests fast.
1 3 Next »