What is “Code Smell”
I bought Fowler’s Refactoring a couple of month back. And I just love going back to it and reading chapters again and again. One of the most interesting phrases used in the book is “Coding Smell”. And it is way easier to migrate legacy code, when your code is refactored and smells as little as possible.
![]()
Today I stumbled across an excellent post concerning Coding Smells at Coding Horror.
To give you a short overview of what Coding Smells are – here is a quote from wikipedia:
In the community of computer programming, code smell is a jargon term used among programmers to refer to a symptom that indicates something may be wrong. It generally indicates that the code should be refactored or the overall design should be reexamined. The term appears to have be coined by Kent Beck on WardsWiki. Usage of the term increased after it was featured in Refactoring. Improving the Design of Existing Code
Determining what is and is not a code smell is often a subject judgment, and will often vary by language, developer and development methodology.
Common Code Smells:
- Large method – a method, function, or procedure that has grown too large.
- Large class – a class that has grown too large.
- Feature envy – a class that uses methods of another class excessively.
- Inappropriate intimacy – a class that has dependencies on implementation details of another class.
- Refused bequeath – a class that overrides a method of a base class’ such that the contract of the base class is not honored by derived class. See Liskov substitution principle.
- Lazy class – a class that does too little.
Some links to articles about “Code Smell”:
- http://wiki.java.net/bin/view/People/SmellsToRefactorings an excellent article about Code Smell and the specific Refactorings per Smell that could help to make your code minty fresh.
- Coding Horror: Code Smells

[...] I just found a book on Amazon that seems to be the database based equivalent to Martin Fowler’s book. It is called Refactoring Databases : Evolutionary Database Design (Addison Wesley Signature Series) and I just can’t wait to get it. If it’s as well written as Fowler’s book, it will be a great source of information about database design. I don’t know about you, but I tend to lern better by reading and understanding bad examples and seeing how somebody fixes those examples. [...]
Pingback on May 29, 2006 @ 16:51:43