I was about to ask a question in the Software Engineering stack exchange channel. I noticed that tags exist for both anti-pattern and code smell.
But isnt every anti-pattern a code smell? and isnt every code smell an anti-pattern?
I was about to ask a question in the Software Engineering stack exchange channel. I noticed that tags exist for both anti-pattern and code smell.
But isnt every anti-pattern a code smell? and isnt every code smell an anti-pattern?
But isnt every anti-pattern a code smell?
If the anti-pattern is directly related to code, yes. But there are also other types of anti-patterns (e.g. Project Management AntiPatterns).
and isnt every code smell an anti-pattern?
No, not necessarily. It's not always a pattern if you find simply badly written code.
So no, these aren't synonyms, and having a separate tag for each is justified.
I should probably just give up trying to explain this, but code smells as the term originally was coined aren't necessarily bad code. They are probable cause to investigate further. They are a hint that something might be wrong, they are not always the something wrong. Someone needs to come up with a name that conveys that better.
For example, comments are considered a code smell, but really they are deodorant, covering up the actual smell. Notice each of those code smells listed have a "When to Ignore" section.
Karl Bielefeldt already explains that in his answer, but I would like to reiterate, because I often see this used wrong:
Kent Beck actually credits the to his mother. The idea is: when it smells, it might be rotten or it might be cheese. You don't know until you investigate.