kludge

lore

programmingops culture

A clumsy, inelegant fix that works despite being ugly.

A kludge (or kluge) solves the problem by force rather than design: the duct tape of software. It is not automatically bad, sometimes it is the honest cost of a deadline, but every kludge is a small deposit into technical debt.

A kludge is a solution that works and should not. It is inelegant, it relies on something incidental, and everyone including its author knows it is wrong, but it ships because the deadline was real and the correct fix was not available in the time remaining.

The word is older than software, coming from engineering slang, and its persistence in computing says something about the profession's relationship with its own compromises. There is affection in it: calling your own work a kludge is a form of honesty, an acknowledgement that you knew better and chose otherwise. The alternative, presenting the same code as a design, is worse.

The practical wisdom is not that kludges are forbidden. It is that they must be labelled. A kludge with a comment explaining what it works around, why the correct approach was unavailable, and what would need to change to remove it is a documented liability someone can retire. The same code without that comment is a mystery that will outlive everyone who understood it, and the archaeology of a large codebase is mostly undocumented kludges nobody dares touch.

Also known as: kluge, kludgy

Sources

  • The Jargon File

All glossary entries