<?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; Architecture</title>
	<atom:link href="http://huddledmasses.org/tag/architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://huddledmasses.org</link>
	<description>You can do more than breathe for free...</description>
	<lastBuildDate>Fri, 27 Apr 2012 05:42:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</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>
		<item>
		<title>Rant: Sometimes I hate my job</title>
		<link>http://huddledmasses.org/rant-sometimes-i-hate-my-job/</link>
		<comments>http://huddledmasses.org/rant-sometimes-i-hate-my-job/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 18:08:52 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://HuddledMasses.org/?p=564</guid>
		<description><![CDATA[So I&#8217;ve been asked to add a feature to one of the apps that I nominally took over when my former manager left &#8230; they want a management pane where certain authorized super users (to be decided later) can add data to the main lookup tables, and must be able to do clean up by [...]]]></description>
			<content:encoded><![CDATA[	<p>So I&#8217;ve been asked to add a feature to one of the apps that I <em>nominally</em> took over when my former manager left &#8230; they want a management pane where certain authorized super users (to be decided later) can add data to the main lookup tables, and must be able to do clean up by deleting data which has been entered erroneously &#8230; including cleaning up any references to the now missing data.</p>

	<p>I&#8217;m currently trying to figure out what database tables I need to be concerned with, and I just have to vent, because this system is the worst mess I&#8217;ve ever seen.  <img src='http://huddledmasses.org/wordpress/wp-includes/' alt='[disgust]' class='wp-smiley' /> </p>

	<ul>
		<li>There&#8217;s one database supporting five or more applications&#8230;</li>
		<li>There are 87 tables (with names like tblAQ_DcSs, tblAQ_SwNw, tblSFM, and tblSW_PWSOS, tblTestCaseTestLayout )</li>
		<li>There are <strong>three</strong> duplicate user tables: tblPeopleLookup, tblUser, and tblUser3 &#8212; tblUser2 is a view onto an external user database which is what is <strong>supposedly</strong> being used &#8230; and apparently, tblPeopleLookup is some sort of mapping from tblUser2 to tblUser3 &#8230; and tblUser1 is the original user table. I don&#8217;t know why these are all still here &#8212; I can only hope none of these others are still being used.</li>
		<li>There are 144 stored procedures (with names like sp_Fix, sp_Fix2, sp_Fix3, spLeftToTestMulti, spLeftToTestMulti2, spLeftToTestMulti3, sp_Whatever, and the awesome spTestCaseTestLayoutTestsUpdate, spTestCaseTestLayoutTestsSelect, etc.)</li>
	</ul>
	<ul>
		<li>There are <strong>no</strong> Foreign Keys.  Yeah. None.  <img src='http://huddledmasses.org/wordpress/wp-includes/' alt='[crazy]' class='wp-smiley' /> </li>
	</ul>

	<p>Technically, there are lots of foreign keys &#8212; it&#8217;s just that none of them are declared as such, so there&#8217;s no referential integrity (did I mention that there&#8217;s an access database floating around out there with linked tables and a hard-coded login which the end-users pass around to each other so they can insert data into some of the tables <strong>by hand</strong> because the original developers didn&#8217;t get around to writing this management app that I&#8217;ve been asked to write now?)</p>

	<p>You can tell that some of the columns <em>should</em> be Foreign Keys, because obviously a column in a &#8220;tblReq_Tag&#8221; table named &#8220;Feature_ID&#8221; must be an external lookup of some sort &#8230; but there&#8217;s 86 other tables &#8230; and at least two of them have Primary Keys called &#8220;Feature_ID&#8221; ...</p>

	<p>So, I&#8217;m spending a lot of time searching the source code and the 144 stored procedures &#8230; An astonishing number of these stored procedures involve cursors and multiple nested case statements.  I just picked one at random which I thought sounded simple: <strong>spEnterGroupResults</strong> ... it&#8217;s about 150 lines of <span class="caps">SQL</span>, and it uses a single cursor variable &#8220;crsUnit&#8221; which it redefines three separate times onto three different queries which it iterates over. Each of these queries involves joins onto nested subqueries, and I count myself lucky because the tricky part is actually enclosed in a transaction, and at least <em>this one</em> isn&#8217;t doing all of that just to dynamically generate a further <span class="caps">SQL</span> query to execute.</p>

	<p>So yeah, I&#8217;m literally looking through source code to try to understand the database design.  The problem is that there are more than five different applications, each using slightly different technologies.</p>

	<ul>
		<li>One of them which has never been migrated from classic <span class="caps">ASP</span> ... with the business logic written entirely in Javascript, and the data handling performed entirely by sending <strong>huge</strong> <span class="caps">XML</span> files back and forth to a &#8220;do all&#8221; webservice.</li>
		<li>One of them was written in VB.<span class="caps">NET</span> in VS 2003, and has never been upgraded.</li>
	</ul>
	<ul>
		<li>The rest are in C# &#8212; with most in VS 2005, and at least one in VS 2008 and C# 3.0 &#8212; some are Asp.Net, some are rich client &#8230;</li>
	</ul>

	<p>The tables I&#8217;m most concerned with right now (for this app) have some <em>ahem</em> ... impressive design decisions of their own.  Of the 8 tables that I&#8217;m looking at directly (I think these are the only ones I need to <em>modify</em> as part of this app), five of them have multi-column primary keys that involve more than half the columns in the table, including columns which are, in fact, unconstrained foreign keys.  And there are so far 5 foreign key looking columns which I haven&#8217;t been able to find the primary key column for &#8230;  <img src='http://huddledmasses.org/wordpress/wp-includes/' alt='[pullhair]' class='wp-smiley' /> </p>

	<p> <img src='http://huddledmasses.org/wordpress/wp-includes/' alt='[new]' class='wp-smiley' />  <strong>Edit</strong>: Oh yeah, and half of these tables have columns like <code>[Enabled] [char](1) NULL</code> &#8230;  That&#8217;s a <strong>boolean</strong> value folks, stored in the database as a <code>y</code> or a <code>n</code> &#8230; and it&#8217;s nullable even though a null (or any value other than <code>y</code> or <code>n</code>, really) will most likely blow up some code somewhere.  And no, there&#8217;s no script constraint or trigger to ensure that this doesn&#8217;t happen (I checked). For extra fun, the other half of the tables use &#8216;bit&#8217; columns for things like this  &#8212; because they were written after I started working with this team (on a different project) and happened across one of these char columns during our one and only code review ever and wondered aloud why we needed to pretend it was still 1992.  Why they just switched, without changing the others, I&#8217;ll never know&#8230;</p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/rant-sometimes-i-hate-my-job/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

