CLEAN stands for five key code qualities that improve software’s maintainability. They are cohesive, loosely coupled, encapsulated, assertive, and non-redundant. These five code qualities make software more straightforward to work with.
I can learn a lot about the kind of coupling in a system by listening to how people talk about testing it. If someone says, “I couldn’t test that without instantiating half the system,” then I know they have some coupling issues. Unfortunately, most systems I have seen—and most systems I know other people have …
Continue reading “Coupling and Testability”
Read MoreWe continue our conversation on code qualities with a discussion of why tight coupling is undesirable. Again, I want to stress, as I did in the last post, that we’re not striving for no coupling in a system. A system with no coupling is a system that does nothing. We want the right kind of …
Continue reading “Pathologies of Tight Coupling”
Read MoreI feel like I try to go around and get developers to do little things that will make a big difference in their work. For example, if you need to add some behavior to your system, rather than putting that behavior into some pre-existing entity, you should probably create a new class for that new …
Continue reading “Cohesion and Testability”
Read MoreUncohesive code is code that either has too many responsibilities or has poorly defined responsibilities. Typically, it’s code that tries to do too much. Poorly cohesive classes are difficult to understand and maintain. They’re harder to debug and more difficult to extend. The bottom line is the more issues a class has to deal with, …
Continue reading “Pathologies of Uncohesive Code”
Read MoreThe first code quality we’ll discuss is my very favorite: cohesion. Cohesive code is highly focused code that’s straightforward and easy to read. I like cohesion because it’s the easiest one for me to spot, but I recognize that that’s not true for everyone. People have told me that cohesion is actually the hardest for …
Continue reading “Quality Code is Cohesive”
Read MoreI like dirty martinis and R-rated movies but my code is one place I always want to keep CLEAN. CLEAN is an acronym I use to remind myself of the five key code qualities that I’ve found to have the biggest impact for improving the maintainability and extendibility of code. Before I describe exactly what …
Continue reading “Keep it CLEAN”
Read MoreQuality is a word we throw around a lot, but without much consensus on what it really means. And it can mean different things in different contexts. Quality in software is very different—the word has a fundamentally different meaning—from quality in goods or services. This is because software is fundamentally different than goods or services. …
Continue reading “Quality in Software”
Read MoreYou may have noticed that I don’t use the XP term duplication when talking about code quality. I prefer to use the term redundancy instead. This is because duplication is the most obvious form of redundancy but redundancy can take many other forms that are far subtler and harder to detect. When I ask developers …
Continue reading “Duplication versus Redundancy”
Read MoreIn my blog post The Single Level of Responsibility Principle, I talked about the virtues of separating out perspectives in code so that any entity is only dealing with a single perspective. In this post, I’d like to tell you about the practice I use that helps me separate out perspectives in code without even …
Continue reading “Programming by Intention”
Read MoreIt’s virtuous to separate out different perspectives in code because it helps make code more testable, extendable, and understandable. We want to use entities at the same level of perspective so that code is easier to read and understand code. The same thing is true within entities where we want to do tasks at the …
Continue reading “The Single Level of Abstraction Principle”
Read MorePeople define quality in software in many ways. Some define quality as software that does what the customer wants. Others define quality as software that runs fast. Still others define quality as software that’s error-free. We all agree these are good things but are they all effects of a single cause, and if so, how …
Continue reading “Seven Strategies for Increasing Code Quality”
Read MoreHow do you define quality? Ford says that quality is job one but what is it and how do we create quality? We all recognize quality service at a fine restaurant and a quality product like a fine piece of furniture but what is quality in software? I ask this question a lot to developers …
Continue reading “What is Quality?”
Read More