<?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>Huddled Masses &#187; Software Engineering</title>
	<atom:link href="http://huddledmasses.org/tag/software-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://huddledmasses.org</link>
	<description>You can do more than breathe for free...</description>
	<lastBuildDate>Sat, 28 Jan 2012 21:37:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='huddledmasses.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Rage Against the Design</title>
		<link>http://huddledmasses.org/rage-against-the-design/</link>
		<comments>http://huddledmasses.org/rage-against-the-design/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 17:52:30 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://huddledmasses.org/rage-against-the-design/</guid>
		<description><![CDATA[So we found a problem recently with a certain scripting language&#8217;s argument parsing: function Test-Argument&#40;$a&#41; &#123; &#160; &#160;$a.GetType&#40;&#41;.FullName &#125; &#91;Test 1&#93;: Test-Argument 4 System.Int32 &#91;Test 2&#93;: Test-Argument .5 System.Double &#91;Test 3&#93;: Test-Argument &#34;hello&#34; System.String &#91;Test 4&#93;: Test-Argument Goodbye System.String &#91;Test 5&#93;: Test-Argument -42 System.String &#91;Test 6&#93;: Test-Argument &#40;-42&#41; System.Int32 &#160; Why can&#8217;t it properly parse [...]]]></description>
			<content:encoded><![CDATA[	<p>So we found a problem recently with a certain scripting language&#8217;s argument parsing:</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$a</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$a</span>.<span style="color: #003366;">GetType</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span>.<span style="color: #003366;">FullName</span><br />
<span style="color: #333;">&#125;</span><br />
<br />
<span style="color: #333;">&#91;</span>Test <span style="color: #cc66cc;">1</span><span style="color: #333;">&#93;</span>: <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span> <span style="color: #cc66cc;">4</span><br />
System.<span style="color: #003366;">Int32</span><br />
<span style="color: #333;">&#91;</span>Test <span style="color: #cc66cc;">2</span><span style="color: #333;">&#93;</span>: <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span> .5<br />
System.<span style="color: #003366; font-weight: bold;">Double</span><br />
<span style="color: #333;">&#91;</span>Test <span style="color: #cc66cc;">3</span><span style="color: #333;">&#93;</span>: <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span> <span style="color: #009900;">&quot;hello&quot;</span><br />
System.<span style="color: #003366; font-weight: bold;">String</span><br />
<span style="color: #333;">&#91;</span>Test <span style="color: #cc66cc;">4</span><span style="color: #333;">&#93;</span>: <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span> Goodbye<br />
System.<span style="color: #003366; font-weight: bold;">String</span><br />
<span style="color: #333;">&#91;</span>Test <span style="color: #cc66cc;">5</span><span style="color: #333;">&#93;</span>: <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span> <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">42</span><br />
System.<span style="color: #003366; font-weight: bold;">String</span><br />
<span style="color: #333;">&#91;</span>Test <span style="color: #cc66cc;">6</span><span style="color: #333;">&#93;</span>: <span style="color: #0066cc; font-style: italic;">Test-<span style="font-style: normal;">Argument</span></span> <span style="color: #333;">&#40;</span><span style="color: #66cc66;">-</span><span style="color: #cc66cc;">42</span><span style="color: #333;">&#41;</span><br />
System.<span style="color: #003366;">Int32</span><br />
&nbsp;</div>

	<p>Why can&#8217;t it properly parse -42 as an integer, when it can parse .5 as a double? Well, according to the development team of a certain Fortune 100 company, this behavior is <strong>by-design</strong> ...  Apparently, &#8220;.&#8221; can be a number, but &#8220;-&#8221; can&#8217;t.</p>

	<blockquote>
		<p>When you know you&#8217;ve got it all wrong, but you can&#8217;t be bothered to get it right, document it &#8212; make it look intentional, and most people won&#8217;t question you.</p>
	</blockquote>

	<p>I&#8217;m sorry folks, but I&#8217;ve had it <strong>up to here</strong> with the &#8220;it&#8217;s by design&#8221; excuse. I don&#8217;t care who you are, and I don&#8217;t care who wrote the design spec &#8212; when something is as obviously wrong as this, <span class="em1">you need to fix it</span>, not just give us platitudes.</p>

	<p>I had the same thing happen recently with a bug I filed about the way wildcard behavior impedes matching file-names with square brackets in them in PowerShell.  They told me this was by design, and that I could use the -LiteralPath parameter.  Well, if any of you have tried this, you already know what I&#8217;m going to say: it&#8217;s broken.</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666666; font-style: italic;">## This works if the file already exists</span><br />
<span style="color: #666666; font-style: italic;">## But fails completely if it doesn't exist</span><br />
<span style="color: #0066cc; font-style: italic;">set-<span style="font-style: normal;">content</span></span> <span style="color: #000066;">-LiteralPath</span> <span style="color: #009900;">&quot;logs [www.example.com].txt&quot;</span> <span style="color: #000066;">-Value</span> <span style="color: #009900;">&quot; help &quot;</span><br />
&nbsp;</div>

	<p>And yet, I was initially told it was <em>supposed</em> to be this way.  Now, in this case, I happened to have the email address of the software architect, and they&#8217;ve <a href="https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=337243&#38;SiteID=99">reopened my bug</a> after I sent him an email with lots of examples of how this <em>bug</em> defied the behavior that a user expects.</p>

	<p>We software developers need to be <em>very</em> careful about saying &#8220;that&#8217;s by design&#8221; ... because it sometimes makes us sound stupid.  When a user says &#8220;this is broken,&#8221; and your reply is &#8220;that&#8217;s by design,&#8221; what the user hears is &#8220;we broke it on purpose.&#8221;  We should not be willing to excuse bad design.</p>

	<p>Listen up: If you want to be a successful software developer, you need to learn this, and learn it well: <span class="em2">the fact that it was <span class="caps">DESIGNED</span> <span class="caps">WRONG</span> is <span class="caps">NOT</span> AN <span class="caps">EXCUSE</span> for shipping broken software</span>.  Regardless of whether it&#8217;s your design, or someone else&#8217;s, even if it was designed this way by your manager&#8217;s boss. When you create software that doesn&#8217;t behave the way the user expects it to, you need to consider the possibility that <strong>you&#8217;re doing it wrong</strong>.</p>

	<p>Imagine if <em>architectural</em> engineers were to behave in a similar manner &#8230; Suppose the original architect of the golden gate bridge had left a gap in the middle of the bridge, with a little ramp: you could drive up the bridge, but you couldn&#8217;t get across unless you were comfortable jumping your car across a four foot opening.</p>

	<p>When you complained about it, the engineers would say: it&#8217;s by design &#8212; if you don&#8217;t like jumping your car (and yes, we know that jumping is bad for maintainability), there is a workaround: just wait for the ferry we put in last year. There are several boats, running continuously, so the wait is at maximum about 20 minutes, and it only takes a little longer to cross by boat than it would on the bridge.</p>

	<p>That analogy is obviously not perfect, but the point is: just because someone decided it should be done a certain way doesn&#8217;t mean that&#8217;s the right thing to do &#8212; sometimes the design is just wrong.  Perhaps the designer and architects overlooked something, or perhaps the circumstances have changed, but in any case, if the software doesn&#8217;t work the way people expect it to work, or requires different workarounds depending on the situation &#8230; you need to question the design.</p>

	<p>All I&#8217;m asking is this: <span class="em3">don&#8217;t turn your brain off</span>: when someone complains about the way something works (or doesn&#8217;t work), think about what they&#8217;re asking, and if the complaint makes sense, don&#8217;t say &#8220;this misbehavior is by design&#8221; until you&#8217;ve reconsidered the design.</p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/rage-against-the-design/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

