Complexity to Fix Complexity
Posted: January 13, 2008 Filed under: General | Tags: arbitrary, complexity, design, hacks 4 CommentsIn Dianetics: The Modern Science of Mental Health, L. Ron Hubbard discusses a principle called the Introduction of an Arbitrary:
An aribtrary structure is one in which one error has been observed and an effort has been made to correct it by introducing another error. In progressive complexity, new errors must be introduced to nullify the evil effects of old errors.
How many times have you seen this happen with a software project? It’s poorly designed in the first place, and then somebody discovers an error. Instead of fixing the design, they tack on some “hack” to fix the error. In other words, just like Ron says, they keep introducing new errors.
It’s long been known that this is a bad idea, but the new idea here is to look at this as a process of introducing errors. Just because some code “fixes a bug” doesn’t mean that it’s not an error to write code that way. You are actually introducing new errors into your program every time you “hack” in a fix instead of fixing the real root cause of a problem.
I think most professional developers have long felt uneasy with “hacking” in a fix, but perhaps didn’t quite have anything to back them up when they protested and said, “I just want to fix it the right way!” However, if we look at “hacks” as errors, then it becomes easier to see why the “right way” is the right way.
So in the future, when you’re fixing an error, don’t introduce new errors to fix it. Do things the “right way.” 🙂
-Max
Max,
I have total reality on your observations here. Elevating the “hack” or “quick fix” to the role of error finishes a shift in reality for me that has been waiting to happen for a while. Thanks.
All of us programmers know that at some point software of any size will need to be completely scrapped and re-written. I have always said this was due to the foundation no longer supporting the added stories of the latest remodel. While this is still true, not introducing errors as you add on will let the program grow taller before the wrecking ball need to be called in. Also, more intelligence and foresight when designing the software to begin with can also forestall this. But I believe the arbitraries we introduce are much more important than I previously recognized.
Of course, a cure for featureitis would also help as added features can act as arbitraries as well. Many programs grow well beyond their original purpose or try to be everything to everyone.
– Brad
Hey Brad! Yeah, I totally agree with everything you said there. 🙂
-Max
You are so right!
I’ve seen this cycle of fixing problems by introducing new problems and then wondering why the program is a piece of garbage. It makes the code hard to maintain and almost impossible to add new features to.
Hahahaha, yeah, you’re telling me! 🙂 That’s what I’ve spent the last three years fixing in Bugzilla! 🙂
-Max