16May/081

Viagra The Little Blue Pill

Viagra the little blue pill So one of the things I've noticed since I've been at my new place of employment, viagra the little blue pill is that people are passionate about their code!  I love it!  I have always been, viagra the little blue pill and its great to be in a place where everyone else is as passionate about it as I am.

Viagra the little blue pill Onto the issue at hand.  Along with passion, viagra the little blue pill comes strong opinions (of course).

Viagra the little blue pill Statement: I always want to create an interface for any service or class that collaborates with other services or classes.

Why?

Viagra the little blue pill Testability.

Viagra the little blue pill IMO (I've got one too!), viagra the little blue pill testability is THE first class citizen (second only to working, viagra the little blue pill value-adding software).

Viagra the little blue pill Having an interface on any collaborating service provides me the ability to (at least):

  • TDD
  • Test after the fact
  • Swap in a new implementation later
  • Low-friction

Why not? (my response to each in red)

  • YAGNI - "Why do you need an interface if there is only one implementer?  We'll create the interface or base class when there is a second implementer".
    There already is a second implementer... Viagra the little blue pill the tests!  Nuff said. Viagra the little blue pill (which is a nice segue into the next point...)
  • Testability should not affect the design.
    Ahem, viagra the little blue pill isn't our goal working software?  How do I know it works if I can't write tests for it?  This directly opposes the entire idea of TDD.  TDD is not so much about testing, viagra the little blue pill as it is about it being a design tool.
  • Just "subclass and override".
    Have you ever read Working Effectively with Legacy Code? This is the epitome of a legacy code technique

Viagra the little blue pill Dear reader (I doubt there are any), viagra the little blue pill

Viagra the little blue pill What do you think?  Are there things I missed on either side of the equation?  I want your opinions.

Tagged as: , 1 Comment