Computing Technical Debt with NDepend
Editorial Note: I originally wrote this post for the NDepend blog. You can check out the original here, at their site. While you’re there, take a look at the newest version of NDepend and its options for helping you quantify tech debt.
For years, I have struggled to articulate technical debt to non-technical stakeholders. This struggle says something, given that technical debt makes an excellent metaphor in and of itself.
The concept explains that you incur a price for taking quality shortcuts in the code to get done quickly. But you don’t just pay for those shortcuts with more work later — you accrue interest. Save yourself an hour today with some copy pasta, and you’ll eventually pay for that decisions with many hours down the road.
So I say to interested, non-technical parties, “think of these shortcuts today as decisions upon which you pay interest down the line.” They typically squint at me a little and say, “yeah, I get it.” But I generally don’t think they get it. At least, not fully.
Lack of Concreteness
I think the reason for this tends to come from a lack of actual units. As a counterexample, think of explaining an auto loan to someone. “I’m going to loan you $30,000 to buy a car. With sales tax and interest factored in, you’ll pay me back over a 5 year period, and you’ll pay me about $36,000 in total.” Explained this way to a consumer, they get it. “Oh, I see. It’ll cost me about $6,000 if I want you to come up with that much cash on my behalf.” They can make an informed value decision.
But that falls flat for a project manager in a codebase. “Oh man, you don’t want us to squeeze this in by Friday. We’ll have to do terrible, unspeakable things in the code! We’ll create so much tech debt.”
“Uh, okay. That sounds ominous. What’s the cost?”
“What do you mean? There’s tech debt! It’ll be worse later when we fix it than if we do it correctly the first time.”
“Right, but how much worse? How much more time?”
“Well, you can’t exactly put a number to it, but much worse!”
And so and and so forth. I imagine that anyone reading can recall similar conversations from one end or the other (or maybe even both). Technical debt provides a phenomenal metaphor in the abstract. But when it comes to specifics, it tends to fizzle a bit.
Jun
5
By Erik Dietrich
Ghost Doc Says the Damndest Things
Category: .NET Tags: C#, Comments, GhostDoc, SubMain | 5 Comments
Editorial Note: I originally wrote this post for the SubMain blog. You can check out the original here, at their site. While you’re there, have a look at GhostDoc, which can help both with code comment maintenance and the generation of help documentation.
Some years ago, I was doing work for some client or another. Honestly, I have no recollections of specifics with the exception of a preference for exhaustive commenting. Every class, every method, every property, and every field.
Of course, I didn’t learn this at first. I didn’t even learn it in a reasonable time frame. Instead, I learned it close to handover time. And so things got a little desperate.
Enter GhostDoc, My Salvation
Now, depending on your perspective, you might scold me for not diligently commenting all along. I will offer the explanation that the code had no public component and no intended APIs or extensions. It also required no “why” types of explanations; this was simple stuff.
The client cited policy. “We comment everything, and we’re taking over this code, so we want you to do the same.” Okie dokie.
Now, I knew that in a world of code generation and T4 templates, someone must have invented a tool that would generate some sort of comments or another. At the time, a quick Google search brought me to a saving grace: the free tool GhostDoc.
While it did not allow me to carpet bomb my code with comments in a single click (and understandably so), it did allow me to do it for entire files at a time. Good enough. I paid my non-commenting penance by spending an hour or so commenting this way.
And do you know what? It generated pretty respectable comments. I recall feeling impressed because I expected empty template comments. Instead, GhostDoc figured out how to string some verbs and nouns together.
Read More