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:
- An anti-pattern is something that is definitely wrong.
- A code smell is something that should be investigated. It might be perfectly okay.
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.