December 18, 2007 12:47:PM
Kevin, You might check out some of the examples of technical debt from my first post on the topic. Here's another example that illustrates the answers to many of your questions.
Let's say that you're developing a large app that requires, among other things, 5 reports. Your plan is to design a set of custom report writer classes that are specific to the nature of the application you're working on and that will make generation of additional reports later on easier. For the sake of expediency, you're being pressured to write the reports using your database's built-in report generator instead. That makes writing the initial set of reports easier (mostly), but once that initial "starter kit" of reports are done, later reports will be more difficult.
Here's how the options I listed before might play out in this example:
Option 1: Good Path
Write all the custom classes, test them, and implement the 5 reports using those classes.
Immediate cost of Good Solution: 10 staff days
Deferred cost to retrofit Good Solution: 0 staff days
Option 1 cost now: $6,000
Option 1 cost later: $0
Option 1 lifetime cost: $6,000
Option 2: Pure Quick & Dirty Path
Use your database's built-in report-writer. This makes generation of 4 of the 5 reports very fast. The fifth report is harder than it otherwise would have been. Going forward, you expect that each report after the first 5 will be harder to write than it otherwise would have been. Moreover, if you ever do implement the originally planned custom report writer, you'll have to go back and regenerate each report in your custom report writer.
Immediate cost of Quick & Dirty solution with possible interest payment: 2 staff days
Deferred cost to retrofit Good Solution: 12 staff days
Estimated cost of "interest payments": 0.5 staff days per report beyond the first 5 (because later reports written using the database's report writer will be harder to write than they otherwise would have been)
Option 2 cost now: $1,200
Option 2 ongoing cost (interest): $300/additional report
Option 2 cost later: $7,200
Option 2 lifetime cost: $9,000 + $300/additional report
Option 3: Quick but not Dirty path
Use your database's built-in report writer, BUT you wrap the database code in a translation layer that presents the same interface that the planned custom report writing code would present. Writing the translation layer takes two extra days, BUT the retrofit cost will be lower because the code for each report will not need to be changed when you swap out the database's report writer and swap in your own custom code.
Immediate cost of Quick & Dirty solution with no interest payment: 4 staff days
Deferred cost to retrofit Good Solution: 9 staff days (1 day less than Option 1 because the interface-creation work is done during the Q&D phase)
Estimated cost of "interest payments": Zero (because later reports can be written to the custom-report interface)
Option 3 cost now: $2,400
Option 3 ongoing cost (interest): $0
Option 3 cost later: $5,400
Option 3 lifetime cost: $7,800
In the short term, Option 3 costs more than Option 2 ($2400 vs. $1200). In the long term, it costs less ($7,800 vs. $9,000+$300/report). But most significantly with Option 3 you don't incur any ongoing interest payment that forces you to go back and implement the originally-planned custom code; you can delay that decision indefinitely.
Like I said in the post, I think it's useful to generate several different design options, rather than just the "quickest and dirtiest" on the one hand vs. the "most pure" on the other hand. Often a hybrid approach ends up being the best option.