More on this book
Community
Kindle Notes & Highlights
Started reading
April 6, 2019
Seiri, or organization (think “sort” in English).
Seiton, or tidiness (think “systematize” in English).
Seiso, or cleaning (think “shine” in English):
Seiketsu, or standardization:
Shutsuke, or discipline
neatness “as a remedy for every degree of evil.”
He who is faithful in little is faithful in much.
You should name a variable using the same care with which you name a first-born child.
Quality is the result of a million selfless acts of care—
I know of one company that, in the late 80s, wrote a killer app. It was very popular, and lots of professionals bought and used it. But then the release cycles began to stretch. Bugs were not repaired from one release to the next. Load times grew and crashes increased. I remember the day I shut the product down in frustration and never used it again. The company went out of business a short time after that.
The answer confirmed my fears. They had rushed the product to market and had made a huge mess in the code. As they added more and more features, the code got worse and worse until they simply could not manage it any longer. It was the bad code that brought the company down.
Perhaps you felt that you didn’t have time to do a good job; that your boss would be angry with you if you took the time to clean up your code. Perhaps you were just tired of working on this program and wanted it to be over.
Every change they make to the code breaks two or three other parts of the code. No change is trivial. Every addition or modification to the system requires that the tangles, twists, and knots be “understood” so that more tangles, twists, and knots can be added. Over time the mess becomes so big and so deep and so tall, they can not clean it up. There is no way at all.
does the only thing they can; they add more staff to the project in hopes of increasing productivity.
The Grand Redesign in the Sky Eventually the team rebels. They inform management that they cannot continue to develop in this odious code base. They demand a redesign. Management does not want to expend the resources on a whole new redesign of the project, but they cannot deny that productivity is terrible. Eventually they bend to the demands of the developers and authorize the grand redesign in the sky.
they have to keep up with the changes that are continuously being made to the old system.
Have you ever waded through a mess so grave that it took weeks to do what should have taken hours? Have you seen what should have been a one-line change, made instead in hundreds of different modules?
We complain that the requirements changed in ways that thwart the original design. We bemoan the schedules that were too tight to do things right. We blather about stupid managers and intolerant customers and useless marketing types and telephone sanitizers. But the fault, dear Dilbert, is not in our stars, but in ourselves.
The Primal Conundrum Programmers face a conundrum of basic values. All developers with more than a few years experience know that previous messes slow them down. And yet all developers feel the pressure to make messes in order to meet deadlines. In short, they don’t take the time to go fast! True professionals know that the second part of the conundrum is wrong. You will not make the deadline by making the mess. Indeed, the mess will slow you down instantly, and will force you to miss the deadline. The only way to make the deadline—the only way to go fast—is to keep the code as clean as
...more
The “code-sense” will help that programmer choose the best variation and guide him or her to plot a sequence of behavior preserving transformations to get from here to there.
The logic should be straightforward to make it hard for bugs to hide,
the dependencies minimal to ease maintenance,
performance close to optimal so as not to tempt people to make the code messy with un...
This highlight has been truncated due to consecutive passage length restrictions.
Bad code tries to do too much,
Clean code is focused. Each function, each class, each module exposes a single-minded attitude that remains entirely undistracted, and unpolluted, by the surrounding details.
Clean code always looks like it was written by someone who cares.
When the same thing is done over and over, it’s a sign that there is an idea in our mind that is not well represented in the code.
If it’s a method, I will always use the Extract Method refactoring on it, resulting in one method that says more clearly what it does, and some submethods saying how it is done.
The next time you write a line of code, remember you are an author, writing for readers who will judge your effort.
Because this ratio is so high, we want the reading of code to be easy, even if it makes the writing harder.
So if you want to go fast, if you want to get done quickly, if you want your code to be easy to write, make it easy to read.
Leave the campground cleaner than you found it.
The cleanup doesn’t have to be something big.
Agile Software Development: Principles, Patterns, and Practices (PPP).
Choosing good names takes time but saves more than it takes.