Code Smell vs Technical Debt
A code smell is a sign in the code that something might be wrong. Technical debt is the cost you pay later for a quick fix you chose. A smell is often how you spot the debt, but not every smell is debt worth paying back.
Code Smell
A hint that code has a deeper problem, even though it works.
A code smell is a sign in the code that something deeper might be wrong. It is not a bug, and the code may work fine today. Common smells are very long functions, the same code copied in many places and functions with too many inputs. Each one makes the code harder to read and change. The usual fix is refactoring.
Technical Debt
The cost you pay later for a quick fix you pick today.
Technical debt is the extra work you take on when you pick a quick fix over a clean one. Like money debt, it can be worth it to ship sooner. But it charges interest: every later change in that area is slower. If nobody pays it down, work can grind almost to a halt. Ward Cunningham coined the term in 1992.
In one line
- Code Smell
- A hint that code has a deeper problem, even though it works.
- Technical Debt
- The cost you pay later for a quick fix you pick today.