Martin Fowler just posted an article on Technical Debt in which he discusses the Technical Debt Metaphor. Fowler argues that the metaphor should (and does) include messy code. He talks about deliberate and inadvertent debt as well as reckless and prudent debt. Prudent and Deliberate is the most desirable. While Reckless and Inadvertent is the least desirable. He published the following quadrant to help explain his concept.
He concludes with a statement about the risks of using the debt metaphor for messy code; "However a problem with using the debt metaphor for this is that I can't conceive of a parallel with taking on a prudent-inadvertent financial debt. As a result I would think it would be difficult to explain to managers why this debt appeared. My view is this kind of debt is inevitable and thus should be expected. Even the best teams will have debt to deal with as a project goes on - even more reason not to recklessly overload it with crummy code."
I would argue that the worst form of debt under this definition is in fact Reckless and Deliberate. This has been the motivation behind my assertion that Messy Code should not be considered Technical Debt. It allows teams to hide messy code behind a comfortable metaphor. We, as programmers, need to hold our standards high. Our goal needs to be a clean code standard.
While I recognize that Messy Code happens inadvertently, I don't think it should happen deliberately without very clear communication to the customer. And when this conversation takes place, I think you need to say, "In order to meet the deadline, we need to write messy code that will cause us problems from here forth until it is cleaned up." rather than saying, "In order to meet the deadline, we need to take on some technical debt."