A blog about software engineering and other topics.written by Jonathan Dodds

July 06, 2004

A Single Point of Correctness

To increase the reliability of a system, engineers strive to eliminate single points of failure. Elimination of a single point of failure is often achieved by adding redundancy.

In the design and in the structuring of code, adding redundancy doesn’t increase reliability. Just the opposite. Duplicate code creates problems.

I once worked with a programmer who could produce great amounts of code very quickly. He achieved these results by prodigiously copying and pasting. The code he produced was difficult to understand and maintain. Fixing a bug could become very involved because it wasn’t enough to identify and understand the issue; it was necessary to find every potential pasted instance of the suspect code.

Strive for a single point of correctness. A single authoritative expression of an idea contributes to greater reliability and cheaper, faster maintainence. If the authoritative expression is wrong the software can be incorrect consistently and there’s just one place to make the fix.