Create CLEAN Code

Nonredundancy and Testability

Redundancy is always a maintenance issue. If you have to change redundant code, you have to do it in multiple places. If you have to extend redundant code, you have to do it in multiple places. When you have to test redundant code, you have to modify tests in multiple places. You get the idea. …

Read More
Create CLEAN Code

Pathologies of Redundant Code

Remember Y2K? Before the turn of the millennium, computer storage was at such a premium that years were stored with only the last two digits so the year 1989 was stored as 89. This worked fine—up until the end of 1999, at which point the year returns to 00 which many programs would interpret as …

Read More
Create CLEAN Code

Quality Code is Nonredundant

The last code quality that we’ll discuss in this series, the “N” in CLEAN, calls for code to be nonredundant. On its surface it seems pretty straightforward but there is some subtlety to redundancy as well. It’s easy to see why redundancy in code is a bad thing. It’s a duplicated effort. It means that …

Read More
Create CLEAN Code

Assertiveness and Testability

It’s quite difficult to test inquisitive code. Very often the results of running a piece of code can only be found in another object. Therefore a test must use a separate entity, which we typically call a “spy,” to monitor the external object and validate that it was called correctly. This adds unnecessary complexity to …

Read More