Nelz's Blog

Mah blogginess

Self Allowances as Code Smell

Lately, I’ve been noticing a theme in development. Sometimes, an organization will grab hold of an edge-case truism and run with it.

I think this is a big vector for code smell… If you give yourself a pass to violate good programming practices too early you are probably doing yourself a disservice, and you will probably suffer the headaches from it later.

According to Wikipedia, "an edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating parameter". If you are going to allow yourself to utilize an edge-case strategy, then you should make sure you are really seeing the ‘extreme operating parameters’. If you end up using this edge-case strategy many times in your code, maybe you need to reevaluate your definition of ‘extreme’.

(And, for those of you wondering, the statement that got me thinking along these lines is this: "sometimes you need to denormalize your data…")