Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Dude, I Just Stepped
I n t o Yo u r C o d e !
Josh Gillespie
Polaris Solutions
St. Louis Days of .NET
Platinum
Sponsors

Gold Sponsors

Silver
Sponsors
What is a code smell?
Wikipedia says…
• In computer programming, code smell is any symptom in
the source code of a program that possibly indicat...
Can you smell that?
Tr a i n y o u r n o s e !
Approach
• Identify the source
• Decide if it indicates a problem
• Decide if the fix is worthwhile
• Refactor
• Retest
Duplicated
Code
Shotgun Surgery
Indecent Exposure
(Feature)
Switch Statements
Long Parameter list
Names
Comments
Questions?
Thank you!
Josh Gillespie
Josh.Gillespie@polarissolutions.com
Metadata
Image Credits
•

http://www.flickr.com/photos/uxud/3666539245/

•

http://www.flickr.com/photos/janramroth/2100683729/

•
...
Bibliography
• Mäntylä, M. V. and Lassenius, C. "Subjective Evaluation of Software
Evolvability Using Code Smells: An Empi...
Upcoming SlideShare
Loading in …5
×

Dude, I just stepped into your code

1,003 views

Published on

Everyone has seen smelly code that makes you cringe, but some smells are more subtle than others. Developing your code nose to recognize smells is a crucial skill for code craftsmanship. In this session we'll learn how to identify and fix smells like Feature Envy, Shotgun Surgery, and Indecent Exposure. Improve your olfactory perception for sweeter smelling code!

Published in: Technology, Sports
  • Be the first to comment

Dude, I just stepped into your code

  1. 1. Dude, I Just Stepped I n t o Yo u r C o d e ! Josh Gillespie Polaris Solutions St. Louis Days of .NET
  2. 2. Platinum Sponsors Gold Sponsors Silver Sponsors
  3. 3. What is a code smell?
  4. 4. Wikipedia says… • In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem. Code smells are usually not bugs—they are not technically incorrect and don't currently prevent the program from functioning. Instead, they indicate weaknesses in design that may be slowing down development or increasing the risk of bugs or failures in the future.
  5. 5. Can you smell that?
  6. 6. Tr a i n y o u r n o s e !
  7. 7. Approach • Identify the source • Decide if it indicates a problem • Decide if the fix is worthwhile • Refactor • Retest
  8. 8. Duplicated Code
  9. 9. Shotgun Surgery
  10. 10. Indecent Exposure
  11. 11. (Feature)
  12. 12. Switch Statements
  13. 13. Long Parameter list
  14. 14. Names
  15. 15. Comments
  16. 16. Questions?
  17. 17. Thank you! Josh Gillespie Josh.Gillespie@polarissolutions.com
  18. 18. Metadata
  19. 19. Image Credits • http://www.flickr.com/photos/uxud/3666539245/ • http://www.flickr.com/photos/janramroth/2100683729/ • http://www.flickr.com/photos/hexadecimal_time/2707620512 • http://www.flickr.com/photos/icanchangethisright/3810853622/ • http://www.flickr.com/photos/92305862@N00/2307386482/ • http://www.flickr.com/photos/mkumm/3043730066/ • http://www.flickr.com/photos/adactio/2856955322/ • http://fallout.wikia.com/wiki/Shotgun_Surgeon • http://www.flickr.com/photos/10804763@N07/1128953541/ • http://www.flickr.com/photos/hey__paul/5841439462/ • http://www.flickr.com/photos/chicanerii/8682931402/ • http://www.flickr.com/photos/dr1066/203919554/ • http://www.flickr.com/photos/bingmanson/6347195986/ • http://www.flickr.com/photos/quinnanya/4869433260/ • http://www.flickr.com/photos/soldiersmediacenter/4621703638/ • http://www.flickr.com/photos/jm3/4683685/
  20. 20. Bibliography • Mäntylä, M. V. and Lassenius, C. "Subjective Evaluation of Software Evolvability Using Code Smells: An Empirical Study". Journal of Empirical Software Engineering, vol. 11, no. 3, 2006, pp. 395-431. • Brown, William J., Raphael C. Malveau, Hays W. McCormick, and Thomas J. Mowbray. Antipatterns: Refactoring Software, Architectures, and Projects in Crisis. NY: Wiley, 1998. • Fowler, Martin, Kent Beck, John Brant, William Opdyke, and Don Roberts. Refactoring: Improving the Design of Existing Code. Reading, MA: Addison-Wesley Professional, 1999. • Bock, David, “The Paperboy, The Wallet, and The Law Of Demeter”. Web. 1 Nov 2013, <http://www.ccs.neu.edu/research/demeter/demetermethod/LawOfDemeter/paper-boy/demeter.pdf> • Atwood, Jeff. “Code Smells”, 18 May 2006. Web. 1 Oct 2013. <http://www.codinghorror.com/blog/2006/05/code-smells.html>

×