<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Simplicity &#187; Creating Complexity</title>
	<atom:link href="http://www.codesimplicity.com/post/category/creating-complexity/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codesimplicity.com</link>
	<description></description>
	<lastBuildDate>Thu, 17 Nov 2011 19:00:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating Complexity: Lock-In To Bad Technologies</title>
		<link>http://www.codesimplicity.com/post/creating-complexity-lock-in-to-bad-technologies/</link>
		<comments>http://www.codesimplicity.com/post/creating-complexity-lock-in-to-bad-technologies/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 19:00:23 +0000</pubDate>
		<dc:creator>Max Kanat-Alexander</dc:creator>
				<category><![CDATA[Creating Complexity]]></category>

		<guid isPermaLink="false">http://www.codesimplicity.com/?p=31</guid>
		<description><![CDATA[  In The Never-Shipping Product, I mentioned seven ways to add complexity, and one of them was &#8220;Lock-In To Bad Technologies.&#8221; But what&#8217;s a &#8220;bad&#8221; technology? Is it all just based on opinion? Should we throw our hands up in the air and give in to the whims of our junior developer who thinks [...]]]></description>
			<content:encoded><![CDATA[<p>  In <a href="/archives/30">The Never-Shipping Product</a>, I mentioned seven ways to add complexity, and one of them was &#8220;Lock-In To Bad Technologies.&#8221; But what&#8217;s a &#8220;bad&#8221; technology? Is it all just based on opinion? Should we throw our hands up in the air and give in to the whims of our junior developer who thinks writing the application in BASIC is a great idea?</p>
<p>  Well, okay, maybe it&#8217;s not <em>all</em> opinion. There must be some way to tell a good technology from a bad one (besides looking back after five years of development and saying, &#8220;Wow, we really shouldn&#8217;t have decided to base our product off of <a href="http://toastytech.com/guis/bob.html">Microsoft Bob</a>.&#8221;)</p>
<p>When I&#8217;m evaluating a technology for inclusion in one of my projects, I look particularly at the technology&#8217;s <em>survival potential</em>, <em>interoperability</em>, and <em>attention to quality</em>. <span id="more-31"></span></p>
<p>  By &#8220;survival potential&#8221; I mean &#8220;how long is this software going to continue to be maintained?&#8221; If you get stuck with libraries or some dependency that becomes obsolete, you&#8217;re really in for some trouble. You can get some idea of the survival potential of the software by seeing how often they&#8217;ve released recently. Also, how responsive are they to bug reports? Do they have a mailing list that&#8217;s very active with users and developers? Are there lots of people online talking about this technology? If a technology has a <em>lot</em> of momentum now, you can be fairly sure that it&#8217;s not going to die any time soon.</p>
<p>  By &#8220;interoperability&#8221; I mean, &#8220;Does this system use some standard that would allow us to switch to a different system if we want, in the future?&#8221; For example, some database systems support <a href="http://savage.net.au/SQL/">standard SQL</a> very well. Some other ones aren&#8217;t as good about that&#8211;they have strange behaviors that don&#8217;t agree with the standard, or they just don&#8217;t support it at all. Using a database with standard-SQL support would allow you to switch to any other standard-SQL database in the future, whereas using a less-standard database would lock you in.</p>
<p>  The final one, &#8220;attention to quality,&#8221; is more of a subjective measurement, but the idea is to see if the product is getting <em>better</em> in its recent releases. If it&#8217;s open-source, check if they&#8217;re refactoring and cleaning up the code base. Is it becoming easier to use or more complex? Do the people who maintain the technology actually care about the quality of their product, or are they just code monkeys working for the pay? Are there are a lot of serious security vulnerabilities in the software that have been published lately?</p>
<p>  Lock-in is a worse problem when you&#8217;re using proprietary software than when your dependencies are open-source. Proprietary vendors can just stop supporting something (or go out of business), whereas in the open-source world anybody is free to pick up a codebase and maintain it if the original maintainers drop it. Granted, open-source projects are just as likely to fall out of existence as proprietary projects are, but at least there&#8217;s the hope (particularly if the project was very popular) that somebody will come around to maintain it again, with open-source.</p>
<p>Proprietary vendors also have a monetary incentive to lock you into their technologies&#8211;even their free technologies. Once you start using their free technologies, they can sell you services and products related to them. Open-source vendors usually lack that monetary incentive, and so are more <em>likely</em> to be &#8220;friendly&#8221; when you want to switch away from them. This isn&#8217;t always true (some proprietary vendors beat the pants off of open-source vendors in terms of interoperability, and some open-source products will still lock you in), but it&#8217;s enough the case that I automatically think &#8220;let&#8217;s use open-source&#8221; when I&#8217;m looking for interoperability.</p>
<p>  There are other aspects to look at when you&#8217;re choosing a technology, and some of it really is opinion. Some people like the way Ruby <em>looks</em> better than the way Python looks. That&#8217;s a valid reason to choose a technology sometimes&#8211;if you just <em>like</em> some technology more than another one, and everything else seems equal according to the criteria above, go with the one that makes you happy. After all, <em>you&#8217;re</em> the one who&#8217;s going to be using it&#8211;your opinion matters! All I&#8217;ve tried to do here is give some <em>universal</em> guidelines that can be used to weed out the definitely bad choices, and the rest is up to your personal research, needs, and desires.</p>
<p> -Max</p>
<p><a href="http://www.codesimplicity.com/post/creating-complexity-lock-in-to-bad-technologies/#comments">Comments: 4</a></p><hr style="margin: 0; margin-top: 0.5em; border: none; border-top: 1px solid black; width: 1.5em"><p>Code Simplicity is brought to you by <a href="http://www.codesimplicity.com/about/">Max Kanat-Alexander</a> and <a href="http://www.bugzillasource.com">BugzillaSource</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.codesimplicity.com/post/creating-complexity-lock-in-to-bad-technologies/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Never-Shipping Product</title>
		<link>http://www.codesimplicity.com/post/the-never-shipping-product/</link>
		<comments>http://www.codesimplicity.com/post/the-never-shipping-product/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 19:00:51 +0000</pubDate>
		<dc:creator>Max Kanat-Alexander</dc:creator>
				<category><![CDATA[Creating Complexity]]></category>

		<guid isPermaLink="false">http://www.codesimplicity.com/?p=30</guid>
		<description><![CDATA[When you work as a professional programmer, you almost always know somebody (or are somebody) who&#8217;s going through one of the most common development horror stories in the book:
&#8220;We started working on this project five years ago, and the technology we were using/making was modern then, but it&#8217;s obsolete now. Things keep getting more and [...]]]></description>
			<content:encoded><![CDATA[<p>When you work as a professional programmer, you almost always know somebody (or are somebody) who&#8217;s going through one of the most common development horror stories in the book:</p>
<p>&#8220;We started working on this project five years ago, and the technology we were using/making was modern then, but it&#8217;s obsolete now. Things keep getting more and more complex with this obsolete technology, so it keeps getting less and less likely that we&#8217;ll ever finish the project. But if we re-write, we could be here for another five years!&#8221;</p>
<p>Another popular one is: &#8220;We can&#8217;t develop fast enough to keep up with modern user needs.&#8221; Or, &#8220;While we were developing, Google wrote a product better than ours much faster than us.&#8221;</p>
<p>When I hear things like that, the first thing I ask myself is &#8220;How did that happen? Why did it take so long for them to finish their product that they ran into that problem?&#8221;</p>
<p>The answer lies in <em>complexity</em>. <span id="more-30"></span> The more complex a task is, the harder it is to complete it. So you start out with something simple that can be completed in one month. Then you add complexity, and the task will take three months. Then you take each piece of that and make it more complex, and the task will take <em>nine</em> months. </p>
<p>Complexity <em>builds</em> on complexity&#8211;it&#8217;s not just a linear thing. It&#8217;s not like, &#8220;We have ten features, and so adding one more will only add 10% more time.&#8221; No, one new feature will have to be coordinated with all ten of your existing features. So if just the feature itself takes 10 hours of coding time, there will be another hour of coding time for that feature interacting with each other feature. The more features there are, the higher the cost gets of adding a feature.</p>
<p>Some projects start out with such a complex set of requirements that they never get a first version out. If you&#8217;re in this situation, you should just trim features. Don&#8217;t shoot for the moon in your first release&#8211;get out something that works and make it work <em>better</em> over time.</p>
<p>There are other ways to add complexity than just adding features, too. The most common other ways are:</p>
<ul>
<li><strong>Expanding the <a href="/archives/7">purpose of the software</a></strong>. Generally, just don&#8217;t ever do that. Your marketing droids might be drooling over the idea of &#8220;making a single piece of software that does your taxes and cooks dinner&#8221;, but you should be <em>screaming</em> as loud as you can whenever any suggestion like that comes near your desk. Stick to your purpose&#8211;your software just has to do what it does <em>well</em>, and you will succeed, if that purpose is something people need.</li>
<li><strong>Adding programmers.</strong> Yes, that&#8217;s right&#8211;adding more people to the team adds <em>complexity</em>, it does not make things simpler. Remember <em><a href="http://www.robelle.com/smugbook/manmonth.html">The Mythical Man Month</a></em>? What he says in there is true because of the complexity equation I explained higher up in this article&#8211;if you have ten programmers, adding an eleventh means spending time to groove in that one programmer, plus the time to groove in the existing ten programmers to the new guy, plus the time spent by the new guy interacting with the existing ten programmers.</li>
<li><strong>Change things</strong>: Any time you change something, you&#8217;re adding complexity. Whether it&#8217;s a requirement, a design, or just a piece of code, you&#8217;re introducing the possibility of bugs, the time required to implement the change, the time required to validate that the new change works with all the other pieces of the software, the time required to decide upon the change, and the time required to track the change, and the time required to test the change. Each change builds on the last in terms of all this complexity, so the more you change, the more and more time each new change is going to take. It&#8217;s still important to make certain changes, but you should be making informed decisions about it, not just changing everything on a whim.</li>
<li><strong>Lock-In to bad technologies</strong>. This is where you make a bad decision about your backend or libraries and then are stuck with it for a long time because you&#8217;re so dependent on it. Obviously &#8220;bad technology&#8221; is very subjective, but sometimes there are obvious good choices and obvious bad ones. For example, if you need an embedded scripting language, <a href="http://www.lua.org/">Lua</a> is generally considered to be a good choice, and &#8220;write our own&#8221; would probably be one of the worse choices, depending on the situation. It&#8217;s definitely relative&#8211;it&#8217;s not like there&#8217;s only one good choice and all the rest are bad, but some choices might make your life easier than others.</li>
<li><strong>Poor design or no design</strong>. Basically, this just means &#8220;a failure to <a href="/archives/19">plan for change</a>.&#8221; Things are going to change, and that requires design work, to maintain simplicity while the project grows. Failing to do this can introduce massive complexity very fast, because suddenly each new feature <em>quadruples</em> the complexity of the code instead of just adding a little bit to the complexity.</li>
<li><strong>Re-inventing the wheel</strong>. For example, if you invent your own protocol when a perfectly good one exists, you&#8217;re going to be spending a <em>lot of time</em> working on the protocol, when you could just be working on your software. You should basically <em>never</em> have any huge invented-in-house dependency, like a webserver, a protocol, or a major library, unless that <em>is</em> your product.</li>
</ul>
<p>The thing about all of these is that they&#8217;re <em>insidious</em>. Most of them only do long-term damage&#8211;something you won&#8217;t see for a year or more. So when somebody proposes them, often they sound harmless! And even when you start implementing them, maybe they seem fine. But as time goes on&#8211;and particularly as more and more of these stack up&#8211;the complexity becomes more apparent and grows and grows and grows, until you&#8217;re another victim of that ever-so-common horror story: &#8220;The Never-Shipping Product.&#8221; (Which is nowhere near as cool as <em>The Neverending Story</em>, believe me.)</p>
<p>-Max</p>
<p><a href="http://www.codesimplicity.com/post/the-never-shipping-product/#comments">Comments: 1</a></p><hr style="margin: 0; margin-top: 0.5em; border: none; border-top: 1px solid black; width: 1.5em"><p>Code Simplicity is brought to you by <a href="http://www.codesimplicity.com/about/">Max Kanat-Alexander</a> and <a href="http://www.bugzillasource.com">BugzillaSource</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.codesimplicity.com/post/the-never-shipping-product/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ways To Create Complexity: Break Your API</title>
		<link>http://www.codesimplicity.com/post/ways-to-create-complexity-break-your-api/</link>
		<comments>http://www.codesimplicity.com/post/ways-to-create-complexity-break-your-api/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 08:13:12 +0000</pubDate>
		<dc:creator>Max Kanat-Alexander</dc:creator>
				<category><![CDATA[Creating Complexity]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bugzilla]]></category>
		<category><![CDATA[salesforce]]></category>

		<guid isPermaLink="false">http://www.codesimplicity.com/archives/13</guid>
		<description><![CDATA[An API is a sort of a promise&#8211;&#8221;You can always interact with our program this way, safely and exactly like we said.&#8221; When you release a new version of your product that doesn&#8217;t support the API from your old version, you&#8217;re breaking that promise.
Above and beyond any vague philosophical or moral considerations about this, the [...]]]></description>
			<content:encoded><![CDATA[<p>An API is a sort of a promise&#8211;&#8221;You can always interact with our program this way, safely and exactly like we said.&#8221; When you release a new version of your product that doesn&#8217;t support the API from your old version, you&#8217;re breaking that promise.</p>
<p>Above and beyond any vague philosophical or moral considerations about this, the <em>technical</em> problem here is that this creates <em>complexity</em>. <span id="more-13"></span></p>
<p>Where once users of your API only had to call a simple function, now they have to do a version check against your application and call one of two different functions depending on the result. They might have to pass their parameters a totally different way now, <em>doubling</em> the complexity of their code if they keep both the old way and the new way around. If you changed a lot of functions, they might even have to re-work their whole application just to fit with the way your new API works!</p>
<p>If you break your API several times, their code will just get more and more and more complicated. Their only other choice is to break <em>their</em> compatibility with old versions of your product. That can make life <em>extremely</em> difficult for users and system administrators trying to keep everything in sync. You can imagine how quickly this could spiral out of control if every piece of software on your system suddenly broke its API for interacting with every other piece of software.</p>
<p>For <em>you</em>, maintaining an old API can be painful, and getting rid of it can make life so much simpler. But it&#8217;s not complexity for <em>you</em> that we&#8217;re talking about particularly here, it&#8217;s complexity for <em>other programmers</em>.</p>
<p>The <em>best</em> way to avoid this problem altogether is <em>don&#8217;t release bad APIs</em>. Or, even better (from the user&#8217;s perspective), create some system where you promise to always maintain the old APIs, but give access to more modern APIs in a different way. For example, you can always access old versions of the <a href="http://www.salesforce.com/us/developer/docs/api/index.htm">salesforce.com API</a> merely by using a different URL to interact with the API. Every time you interact with the SalesForce API, you are in fact specifying exactly what version of the API you expect to be using. This approach is a lot easier in centralized applications (like salesforce.com) than in shipping applications (like <a href="http://www.bugzilla.org/">Bugzilla</a>), because shipping applications have to care about code size and other things. Maintaining old APIs is also very difficult if you only have a small team of developers, because that maintenance really takes a lot of time and attention.</p>
<p>In any case, releasing an unstable or poor API is going to either complicate <em>your</em> life (because you&#8217;ll then have to maintain backwards compatibility forever) or the life of your API users (because they&#8217;ll have to modify all of their applications to work with both the &#8220;good&#8221; and &#8220;bad&#8221; API versions).</p>
<p>If you choose to break your API and not provide backwards-compatibility, remember that some API users will never update their products to use your new API. Maybe they just don&#8217;t have the time or resources to update their code. Maybe they are using a tool that interacts with your product, but the maintainer of the tool no longer provides updates. In any case, if the cost of fixing <em>their</em> code is greater than the value of upgrading to new versions of your product, they could choose to remain with an old version of your product <em>forever</em>.</p>
<p>That can have a lot of unforseen consequences, too. First they keep around an old version of your product. Then they have to keep around old versions of certain system libraries so that your product keeps working. Then they can&#8217;t upgrade their OS because the old version of your product doesn&#8217;t work on the new OS. Then what do they do if some unpatched security flaw is exploited on their old OS, but they&#8217;re still tied to your old product and so can&#8217;t upgrade their OS? Or some security flaw in your old product is exploited? All of these situations are things that you have to take responsibility for when you choose to break your API.</p>
<p>And yet, having <em>no</em> API can lead to the same situation. People create crazy &#8220;hacks&#8221; to interact with your system, and then they can&#8217;t upgrade because their hacks don&#8217;t work on the new version. This is not as bad as breaking your API, because you never <em>promised</em> anything about the hacks. Nobody has the right to <em>expect</em> their hacks to keep working. But still, if management <em>orders</em> them to integrate with your product, those clever programmers will find any possible way to make it work, even if it sticks them with one version of your product forever.</p>
<p>So definitely make an API if you have the development resources to do it. But put a lot of careful thought into your API design before implementing it. Try actually using it yourself. Survey your users carefully and find out exactly how they want to use your API. Generally, do everything in your power to make the API as stable as possible before it&#8217;s ever released. It&#8217;s not a matter of spending years and years on it, it&#8217;s just a matter of taking some sensible steps to find out <em>how</em> the API should really work before it&#8217;s ever released.</p>
<p>And once it&#8217;s released, please, <em>please</em>, if you can help it, don&#8217;t break the API.</p>
<p>-Max</p>
<p><a href="http://www.codesimplicity.com/post/ways-to-create-complexity-break-your-api/#comments">Comments: 5</a></p><hr style="margin: 0; margin-top: 0.5em; border: none; border-top: 1px solid black; width: 1.5em"><p>Code Simplicity is brought to you by <a href="http://www.codesimplicity.com/about/">Max Kanat-Alexander</a> and <a href="http://www.bugzillasource.com">BugzillaSource</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.codesimplicity.com/post/ways-to-create-complexity-break-your-api/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

