<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:zunger</id>
  <title>Yonatan Zunger</title>
  <subtitle>Yonatan Zunger</subtitle>
  <author>
    <name>Yonatan Zunger</name>
  </author>
  <link rel="alternate" type="text/html" href="http://zunger.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://zunger.livejournal.com/data/atom"/>
  <updated>2010-03-19T03:45:33Z</updated>
  <lj:journal userid="567575" username="zunger" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://zunger.livejournal.com/data/atom" title="Yonatan Zunger"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:zunger:167779</id>
    <link rel="alternate" type="text/html" href="http://zunger.livejournal.com/167779.html"/>
    <link rel="self" type="text/xml" href="http://zunger.livejournal.com/data/atom/?itemid=167779"/>
    <title>zunger @ 2010-03-18T20:45:00</title>
    <published>2010-03-19T03:45:33Z</published>
    <updated>2010-03-19T03:45:33Z</updated>
    <content type="html">While reviewing some code today, a principle of software design somehow distilled itself to clarity in my head. &lt;br /&gt;&lt;blockquote&gt;When designing your system, think of every major system&lt;sup&gt;1&lt;/sup&gt; upon which your own system directly depends&lt;sup&gt;2&lt;/sup&gt; as a bug.&lt;/blockquote&gt;&lt;br /&gt;By "think of it as a bug," I mean that sooner or later, you are going to come to truly hate this dependency. It won't do what you want, or it will turn old and crufty, or it will get outdated, or your system will outgrow it. Perhaps it already stinks. And therefore, think about what you are going to have to do to take it out and replace it with something better, and possibly not even having similar API's.&lt;br /&gt;Yes, you should have your code sufficiently factored and modular that such a replacement will be minimally invasive. But more importantly: if that replacement requires any change in the API's&lt;sup&gt;3&lt;/sup&gt; by which the outside world is using your system, then there is something wrong with your design. Stop and fix that immediately.&lt;br /&gt;&lt;br /&gt;&lt;sup&gt;1&lt;/sup&gt;Both external dependencies and major subsystems of your own code. Both will suck in time, I promise you.&lt;br /&gt;&lt;sup&gt;2&lt;/sup&gt;If the systems upon which you directly depend have done this properly, you don't need to worry about your indirect dependencies. If they haven't, then you should consider replacing them &lt;i&gt;now&lt;/i&gt;, because you are obviously dealing with the work of madmen.&lt;br /&gt;&lt;sup&gt;3&lt;/sup&gt;Or UI's, if your software is at the top of its software stack. UI's are just API's for communicating efficiently with humans. (Or perhaps API's are just UI's for communicating with computers?)</content>
  </entry>
</feed>
