This presentation reviews some of the most common and dangerous code smells and anti-patterns supported by some debate about why they should be avoided. There are many examples and a lot of interactive discussion to help illustrate the virtues of identifying anti-patterns in our code and how to fix them. Learn cool new terms like object orgy, shotgun surgery and contrived complexity! Become a better developer! Impress your friends!
I decided to write this presentation after a particularly frustrating day at work. I had just spent nearly half of a day troubleshooting down a rabbit hole in an excruciatingly over-architected web project. When I reached the bottom, it was a 3-line code change. The initial wave of pride and excitement soured into frustration over so much time spent tracking down the source of a minor bug in someone else’s steaming pile of code — someone I had never met before.
Following that experience, I had a very strong desire to prevent the same from happening to someone else. If this presentation can prevent even one incident like this from occurring, then it will have been worth it.
Other than the introduction and wrap-up, this is a non-linear presentation. The anti-patterns discussed and the time spent on each will vary based on the setting and audience. Because of this, the length of the presentation is very flexible. While typically scheduled for 60-minutes, this presentation can also be used as a 90- or 120-minute topic.
- St. Louis Days of .NET 2014 (2014-11-13)
- CodeStock 2014 (2014-07-11)
- Kansas City Developer Conference 2014 (2014-05-15)
- Iowa Code Camp, Fall 2012 (2012-10-27)
- St. Louis Days of .NET 2012 (2012-08-02)
- South Florida Code Camp 2013 (2013-02-09)
- Nebraska Code Camp, Spring 2013 (2013-03-15)
- Kansas City Developer Conference 2013 (2013-05-02)
- What is an anti-pattern? Define anti-pattern with an analogy.
- What is a code smell? Define code-smell with an analogy, and contrast with anti-pattern.
- This presentation has a pattern. Describe the format of the rest of the presentation.
- Anti-Patterns Dive in and discuss some specific anti-patterns.
- Magic Number / Magic String
- Hard Code
- Soft Code
- Error Hiding
- Cargo Cult Programming
- Feature Envy
- Object Cesspool
- Object Orgy
- Input Kludge
- God Object
- Sequence Coupling
- Blind Faith
- Take-Aways and Wrap-up