title: What programming practice that you once liked have you since changed your mind about?
body: <p>As we program, we all develop practices and patterns that we use and rely on. However, over time, as our understanding, maturity, and even technology usage changes, we come to realize that some practices that we once thought were great are not (or no longer apply).</p>
  
  <p>An example of a practice I once used quite often, but have in recent years changed, is the use of the <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="nofollow noreferrer">Singleton object pattern</a>. </p>
  
  <p>Through my own experience and long debates with colleagues, I've come to realize that <a href="https://stackoverflow.com/questions/162042/are-there-any-viable-alternatives-to-the-gof-singleton-pattern">singletons are not always desirable</a> - they can make testing more difficult (by inhibiting techniques like mocking) and can create undesirable coupling between parts of a system. Instead, I now use object factories (typically with a IoC container) that hide the nature and existence of singletons from parts of the system that don't care - or need to know. Instead, they rely on a factory (or service locator) to acquire access to such objects.</p>
  
  <p>My questions to the community, in the spirit of self-improvement, are:</p>
  
  <ul>
  <li>What programming patterns or practices have you reconsidered recently, and now try to avoid? </li>
  <li>What did you decide to replace them with?</li>
  </ul>