There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter

Code Smell

A code smell is a hint that something might be wrong somewhere in your code. I have seen various versions on the Internet listing what code is considered code smell. I agree with some, don't agree with others. Here is what I consider to be code smell:

  • Duplicate Code
  • Long Method (any method longer than 30 lines)
  • Large Class (> 1000 lines of “code, comments, and blank lines” when properly formatted)
  • Parameter List with more than 5 parameters
  • Methods that do not contain a verb
  • Properties that do contain a verb
  • Same Name, Different Meaning
  • Excessive Overloading
  • Classes that do not do just one thing
  • Too many comments. The code itself should explain what it is doing. Comments should explain business rules or why a particular algorithm was used.
  • Long Class, Method, or Property names
  • Temporary Fields
  • Too many conditionals
  • Double-Negatives
  • “Magic” Numbers
  • More than one type (class, interface, enum, etc.) per file.
Copyright © 2015 by Julian Easterling. SOME RIGHTS RESERVED.

Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.


All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.