Thursday, January 21, 2016

Technical Debt is a Leaky Abstraction, but so what

Technical debt is a recent term in software engineering used to describe potential later problems that may be caused by known decisions now. For example, suppose a customer asks for a feature that can be implemented cheaply and quickly, but it will introduce security holes or be very difficult to generalize if done quickly, or will prevent another rare feature from working without lots of rework. You're making things work now for some pain later. You would have much less total pain overall if you 'do it right' today, but cheaply and quickly are more important.


(from collab.net)

Saying 'we have a lot of technical debt in our software' is very loose talk for 'we have either a lot of bugs that no one is complaining about' or 'we don't do code review so I bet there's a lot of crap that gets deployed'.

A leaky abstraction is another metaphor in software engineering. When one creates a new layer intended to hide all the details of a lower layer, For example, floating point numbers are leaky because they try to hide all the gross details of finite bits per number approximating perfect precision of the desired  numbers, but sometimes you end up having to be aware of the underlying implementation because they leak through the abstraction (eg a+b usually equals b+a except when b is much smaller than a, and to deal with that you need to know some details of how the floating point ops really work under the hood).

Technical debt is a leaky abstraction in that the metaphor cannot be taken too literally; if you try to follow implications of the words, it breaks. Debt is a balance in a ledger, you can owe or be owed a value. Technical debt, being very qualitative, is hard to put into numbers, you just have a vague sense of 'this is bad' vs 'this is really bad' vs 'this is tolerable'. The debt isn't really about the features themselves but about the time and mental effort needed to implement things.

The first picture is a terrible explanation, the following is much better:


(from commadot.com)

All I'm saying is that technical debt is a leaky abstraction, a faulty metaphor. There's no paying back, it's just cleanup.

Using the term is great because it is more politic than saying 'The code is a mess and needs some cleanup. Features are really hard to add'.

No comments: