🧪Code Smell
Also known as Code Smells, Smell
A hint that code has a deeper problem, even though it works.
Think of it like
Think of it like a funny smell in the fridge. It is not proof of a problem, but you should look.
Example
Jack finds the same 15 lines of tax code pasted in four files. It works, but it smells: a tax change now means four edits.
Why it matters
Smells are cheap to fix early and dear to fix late, once more code has grown around them.
Definition
Common mistake
Key takeaways
- 1A warning sign. Not a bug.
- 2Common ones. Long, copied, too many inputs.
- 3Fixed by refactoring. When it is worth it.