<?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>ThotSpots &#187; design principles</title>
	<atom:link href="http://www.thotspots.com/tag/design-principles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thotspots.com</link>
	<description>Agile Software Development</description>
	<lastBuildDate>Wed, 09 Sep 2009 18:13:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8220;Clean Code&#8221; &#8212; Crafting On Principles</title>
		<link>http://www.thotspots.com/clean-code-book/</link>
		<comments>http://www.thotspots.com/clean-code-book/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 21:26:00 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[design principles]]></category>
		<category><![CDATA[naming conventions]]></category>
		<category><![CDATA[Robert Martin]]></category>
		<category><![CDATA[simplicity]]></category>

		<guid isPermaLink="false">http://www.thotspots.com/?p=109</guid>
		<description><![CDATA[I&#8217;ve been reading &#8220;Clean Code: A Handbook of Agile Software Craftsmanship&#8221; by Robert Martin.  This is no ordinary book on writing better software.  It&#8217;s not just a rehash of &#8220;Code Complete&#8221; or &#8220;The Pragmatic Programmer.&#8221;  Those are both fine books, but &#8220;Clean Code&#8221; is different.  So, please don&#8217;t think that if [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading &#8220;<a href="http://www.amazon.com/gp/product/0132350882?ie=UTF8&#038;tag=thotspots-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0132350882">Clean Code: A Handbook of Agile Software Craftsmanship</a><img src="http://www.assoc-amazon.com/e/ir?t=thotspots-20&#038;l=as2&#038;o=1&#038;a=0132350882" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />&#8221; by Robert Martin.  This is no ordinary book on writing better software.  It&#8217;s not just a rehash of &#8220;Code Complete&#8221; or &#8220;The Pragmatic Programmer.&#8221;  Those are both fine books, but &#8220;Clean Code&#8221; is different.  So, please don&#8217;t think that if you&#8217;ve read one, you&#8217;ve read them all.</p>
<p>In Clean Code, Martin doesn&#8217;t just name the best practices we should all be following.  He explains the reasoning behind each one and gives names to the concepts.  Just as the idea of software design patterns revolutionized the way we think and talk about software architecture, Martin&#8217;s exploration of day-to-day coding habits gives us a smarter way to think and talk about that.</p>
<p>Case in point: Clean Code kicks off with the practice of giving your objects meaningful names.  One aspect of this is that good names do not require anyone who might read your code in the future to have to perform any &#8220;mental mappings.&#8221;  Here&#8217;s an example of this that I came across just the other day.<span id="more-109"></span></p>
<pre>var ld = new LoginData();</pre>
<p>Look carefully, that&#8217;s a lower-case <span style="font-family: courier new,courier,monospaced">L</span>.  At first glance, it looks like a capital <span style="font-family: courier new,courier,monospaced">I</span>, as in &#8220;ID,&#8221; as in &#8220;identifier.&#8221;  I don&#8217;t know how long I spent confused about how a class constructor could be returning an identifier when reading through this code for first time.  Maybe ten or fifteen seconds?  Time in which I was completely distracted from understanding the rest of the code, having pushed that problem onto the stack, as it were, in order to first solve this mini-problem.</p>
<p>Even without the <span style="font-family: courier new,courier,monospaced">I</span> vs. <span style="font-family: courier new,courier,monospaced">L</span> confusion, using an abbreviated variable name meant that whenever I came across it, I had to keep reminding myself that it stood for an instance of LoginData.  That may not seem like a big deal, but we humans only have so much stack space before we run out of short-term memory.  When a program is full of one- and two-letter variable names that must be continually translated mentally, it leaves no room for thinking about the actual problem that the program is trying to solve.</p>
<p>All of this could have been avoided if the name was spelled out to begin with, so I changed it (using the automated rename refactoring tool in my IDE):</p>
<pre>var loginData = new LoginData();</pre>
<p>&#8220;One difference between a smart programmer and a professional programmer is that the professional programmer understands that clarity is king.  Professionals use their powers for good and write code that others can understand.&#8221; ~ Robert (Uncle Bob) Martin</p>
<p>Martin could have just said, &#8220;don&#8217;t use abbreviations in variables names, because you&#8217;ll make the reader translate it in his head every time he reads it,&#8221; and that would have been terrific advice alone.  But what he really gives you is a deep understanding of the key principles involved, so that you won&#8217;t need to memorize a bunch of arbitrary coding standards in order to write cleaner code.  Instead, you&#8217;ll be armed with a few simple, understandable principles to guide you, with clean code being the natural outcome.</p>
<p>Clean Code is a must-read for everyone in the software profession &#8212; from college freshmen on up to CTOs &#8212; especially anyone who finds himself out of work in this economy (or worried about the possibility).  Learning to write clean code, and thus to write more valuable code, is probably the single most effective thing you can do for yourself. Programmers are expensive resources.  The work we produce is costly.  It&#8217;s up to us to treat it with the respect it deserves, to try and make it as valuable as possible, and to maintain that value as long as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/clean-code-book/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is Extreme Programming (XP)?</title>
		<link>http://www.thotspots.com/what-is-extreme-programming-xp/</link>
		<comments>http://www.thotspots.com/what-is-extreme-programming-xp/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 01:47:43 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[Agile development]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[design principles]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.maximsc.com/what-is-extreme-programming-xp/</guid>
		<description><![CDATA[The other day, I was asked for the &#8220;elevator pitch&#8221; on XP, so I dug out this description from an old posting on another of my sites.
It&#8217;s taking best practices to the extreme&#8230;

Long iterations become short iterations with early experience
Long, irregular meetings become frequent stand up meetings
Back-end testing becomes unit testing
Specification artifacts become stories and [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I was asked for the &#8220;elevator pitch&#8221; on XP, so I dug out this description from an old posting on another of my sites.</p>
<h3>It&#8217;s taking best practices to the extreme&#8230;</h3>
<ul>
<li>Long iterations become short iterations with early experience</li>
<li>Long, irregular meetings become frequent stand up meetings</li>
<li>Back-end testing becomes unit testing</li>
<li>Specification artifacts become stories and a full-time customer (proxy)</li>
<li>Enforced deadlines become developer-derived estimates</li>
<li>Code reviews become pair programming</li>
</ul>
<p><span id="more-42"></span></p>
<h3>The XP Values</h3>
<ul>
<li>Communication</li>
<li>Feedback</li>
<li>Simplicity</li>
<li>Courage</li>
</ul>
<h3>The Tenets of Extreme Programming &amp; Refactoring</h3>
<ul>
<li>Establish a guiding vision, or &#8220;metaphor,&#8221; and then design as you go, with no big, up-front design.</li>
<li>Do the simplest thing that works, at first, and then refactor as needed.</li>
<li>No &#8220;Spec Gen&#8221; (speculative generality). Rely on refactoring to add features only as they actually become required.</li>
<li>No speculative performance tuning.  Rely on refactoring to introduce performance tuning later.</li>
<li>Code in small iterations and fast release cycles.</li>
<li>Put unit and functional testing at the core of the project goal posts, not as an optional add-on.  In fact, write the tests before you write the code to be tested.  You cannot rely on refactoring without a complete baseline of unit tests.</li>
<li>Do not refactor and add functionality at the same time.  Alternate between them.</li>
<li>Coding standards should have buy-in by all team members and call for the least amount of work possible.</li>
<li>Work directly with an on-site customer and/or user and make them a part of the programming team.</li>
<li>The customer determines the priorities, not the developers.</li>
<li>Developers provide the estimates, not the customer.</li>
<li>&#8220;Spikes&#8221; are written when preliminary research is required to provide a confident estimate.</li>
<li>The entire development team has collective ownership of the entire project.  It is not portioned-out code to individual experts.</li>
<li>Program in pairs to assure quality and stay on track.</li>
<li>Use stand-up meetings to stay on track.</li>
<li>Stick to a 40-hour workweek, sleep well and lead a balanced, healthy lifestyle.</li>
</ul>
<h3>Getting Started</h3>
<ol>
<li>Kent Beck&#8217;s &#8220;Extreme Programming Explained&#8221; (second edition) is the seminal work in the field.  It&#8217;s an easy read and it paints a good overall picture.</li>
<li>Martin Fowler&#8217;s &#8220;Refactoring: Improving the Design of Existing Code&#8221; is a must-read.  The first 100 pages describes refactoring (and a bit about test-driven development).  The remaining pages are a catalog of refactorings &#8212; essentially a cookbook of step-by-step recipes.</li>
<li>Robert Martin&#8217;s &#8220;Agile Software Development&#8221; has also been recommended as a good starting point, though it&#8217;s not primarily about XP.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/what-is-extreme-programming-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Head First&#8221; Book Sometimes Makes My Head Hurt</title>
		<link>http://www.thotspots.com/head-first-book-sometimes-makes-my-head-hurt/</link>
		<comments>http://www.thotspots.com/head-first-book-sometimes-makes-my-head-hurt/#comments</comments>
		<pubDate>Sat, 17 Feb 2007 01:17:19 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[design principles]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.thotspots.com/?p=23</guid>
		<description><![CDATA[[This review originally appeared in my personal blog on Sept 8, 2005.  I'm reposting it by request.]

IÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢m helping out with a study group for "Head First Design Patterns," which just finished chapter 6. On the whole, itÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢s a pretty good introduction to software design patterns ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Å“ way more accessible than the seminal work by the Gang of Four; however, the examples sometimes make my head hurt. I canÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢t imagine what theyÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢re doing to the heads of the beginners in the group. Coming up with decent examples is the hardest thing to do in expository writing, and]]></description>
			<content:encoded><![CDATA[<p>[This review originally appeared in my personal blog on Sept 8, 2005.  I'm reposting it by request.]</p>
<p>I&#8217;m helping out with a study group for &#8220;Head First Design Patterns,&#8221; which just finished chapter 6. On the whole, it&#8217;s a pretty good introduction to software design patterns &#8212; way more accessible than the seminal work by the Gang of Four; however, the examples sometimes make my head hurt. I can&#8217;t imagine what they&#8217;re doing to the heads of the beginners in the group. Coming up with decent examples is the hardest thing to do in expository writing, and I certainly give the authors an E for effort in creativity, but I wish they had been a little less concerned with making their examples &#8220;hip&#8221; and a little more concerned with making them appropriate.<br />
<span id="more-23"></span><br />
To wit, the whole pizza store analogy in chapter 4 (to illustrate factory method and abstract factory) is flawed. For one thing, that&#8217;s just not the way you&#8217;d model a pizza business in any actual software that I can imagine. For another, the differences between a New York pizza factory and a Chicago pizza factory are too subtle/trivial to make for an effective illustration of why you would need to subclass anything (much less use a factory to manage the subclasses). A much better example, as everyone in my group agreed, would have been an application that needs to offer up a consistent set of functionality to users who are accessing it in wildly different ways: one&#8217;s in a web browser on a desktop, another is running a cell phone app, another is using a touch-tone phone, and yet another is using a voice-activated headset. All the client code knows is that, for example, it needs to ask a multiple-choice question and obtain the answer. It&#8217;s up to an abstract factory to provide the client with a set of classes that can do that, in the context of the selected user-interface, in whatever way is necessary.</p>
<p>To a lesser degree, the Starbucks coffee example at the beginning of the book suffers from the same too-hip-to-be-effective syndrome, although I do think that the remote-control example for the Command pattern in chapter six is dead on.</p>
<p>For any novice who is reading this book without the benefit of a study group, I highly suggest that you find at least one other programmer who is experienced in design patterns to explain why/if/how the examples are lacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/head-first-book-sometimes-makes-my-head-hurt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Magic Number Seven WRT the Framework Simplicity Conundrum</title>
		<link>http://www.thotspots.com/the-magic-number-seven-wrt-the-framework-simplicity-conundrum/</link>
		<comments>http://www.thotspots.com/the-magic-number-seven-wrt-the-framework-simplicity-conundrum/#comments</comments>
		<pubDate>Sun, 11 Feb 2007 05:48:07 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[design principles]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[simplicity]]></category>

		<guid isPermaLink="false">http://www.thotspots.com/?p=22</guid>
		<description><![CDATA[Mid last year, Kurt Williams wrote "Beware of Simplicity" [<a HREF="http://jroller.com/page/cardsharp?entry=beware_simple_frameworks">jroller.com/page/cardsharp?entry=beware_simple_frameworks</a>] in development frameworks.  According to him, new and fresh frameworks can only claim to be simple because they are immature.  All frameworks are doomed to growing more complex as they grow in features.  I can't argue with that.  It seems to me, therefore, that the best frameworks are the ones that do the best job of hiding that complexity -- either because of the innate architecture of the framework, or by virtue of the tools and practices that deal with the complexity for you.  A framework can have all of the under-the-hood complexity it needs.  It's the day-to-day, in-your-face complexity that I care about.

In the field of cognitive psychology there's this so-called "Magic Number 7."  Basically, the idea is that humans can only keep 7 disjointed "things", plus or minus two, in short-term memory at once.  To see what I mean, study the following list of words for a minute.  Then, turn away and write down as many as you can from memory:]]></description>
			<content:encoded><![CDATA[<p>Mid last year, Kurt Williams wrote &#8220;<a href="http://jroller.com/page/cardsharp?entry=beware_simple_frameworks">Beware of Simplicity</a>&#8221; in development frameworks.  According to him, new and fresh frameworks can only claim to be simple because they are immature.  All frameworks are doomed to growing more complex as they grow in features.  I can&#8217;t argue with that.  It seems to me, therefore, that the best frameworks are the ones that do the best job of hiding that complexity &#8212; either because of the innate architecture of the framework, or by virtue of the tools and practices that deal with the complexity for you.  A framework can have all of the under-the-hood complexity it needs.  It&#8217;s the day-to-day, in-your-face complexity that I care about.</p>
<p>In the field of cognitive psychology there&#8217;s this so-called &#8220;Magic Number 7.&#8221;  Basically, the idea is that humans can only keep 7 disjointed &#8220;things&#8221;, plus or minus two, in short-term memory at once.  To see what I mean, study the following list of words for a minute.  Then, turn away and write down as many as you can from memory:<br />
<span id="more-22"></span><br />
Apricot, ladder, storm, headphones, spark-plug, sneaker, anchor, coin, library, twenty-seven, lyrics, nail, telescope, onion.</p>
<p>How&#8217;d you do?  I could only recall nine of them (even though I was the one who made up the darn list just now), and in fact, I had to work hard to recall the eighth and ninth.  By the way, IQ has nothing to do with this number.  Whether you&#8217;re closer to Mensa or Densa, your short-term recall factor will still be 7 +/- 2.  (See <a href="http://en.wikipedia.org/wiki/The_Magical_Number_Seven%2C_Plus_or_Minus_Two">Wikipedia</a> and George Miller&#8217;s 1956 paper that first noted the phenomenon is at <a href="http://www.musanim.com/miller1956/">www.musanim.com/miller1956/</a>.)</p>
<p>As the Wikipedia article points out, Ed Yourdon first commented on how this relates to computer science back in 1979.  He described what we would today refer to as the long-method smell (see <a href="http://www.soberit.hut.fi/mmantyla/BadCodeSmellsTaxonomy.htm">www.soberit.hut.fi/mmantyla/BadCodeSmellsTaxonomy.htm</a>), citing the magic number 7 as why it&#8217;s bad to tax the short-term memory of someone trying to understand a piece of code.</p>
<p>So, how often does your web framework require you to keep track of more than seven things at once?  Take, for example, the simple task of creating a data-entry page.  How many different files need to be created or modified to accomplish this? One for the HTML template, one for the page logic, multiple files for each model object (interface, impl, and ORM mapping), the DAO (interface and impl), the config file with the URL construction rules, the config file with the user security rules, the config file that lists all of the pages on the site, the interface file with constants for all those page names?  &#8212; That&#8217;s eleven and counting.  Sound familiar?  This amount of complexity often leads to things falling through the cracks, and is usually reflected in a high number of bug reports.</p>
<p>From what I have seen, Ruby on Rails has made this particular task as simple as it can be, and that accounts for a great deal of RoR&#8217;s appeal, I&#8217;m sure.  Even .Net has this down cold.  In the case of RoR, it&#8217;s an innate feature of the framework.  In the case of .Net, it&#8217;s simplified by the tools.  I&#8217;m still waiting for a Java-based framework/environment that &#8220;gets it&#8221; in this regard.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/the-magic-number-seven-wrt-the-framework-simplicity-conundrum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TDD Solves the Blank Page Syndrome</title>
		<link>http://www.thotspots.com/tdd-solves-the-blank-page-syndrome/</link>
		<comments>http://www.thotspots.com/tdd-solves-the-blank-page-syndrome/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 02:31:48 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[design principles]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[test-driven]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.thotspots.com/?p=20</guid>
		<description><![CDATA[In my personal blog I wrote about how the blank page syndrome can lead to <a HREF="http://tankardsaweigh.blogspot.com/2007/02/stupid-procrastination-advice.html">procrastination</a>.  I gave an example of how it's often difficult to know where to start when faced with a vaguely written bug report or an enhancement request.  I suggested that one way to gain clarity is]]></description>
			<content:encoded><![CDATA[<p>In my personal blog I wrote about how the blank page syndrome can lead to <a href="http://tankardsaweigh.blogspot.com/2007/02/stupid-procrastination-advice.html">procrastination</a>.  I gave an example of how it&#8217;s often difficult to know where to start when faced with a vaguely written bug report or an enhancement request.  I suggested that one way to gain clarity is<!--break--> to skip ahead to writing the bug-resolution documentation as if you had already done the work.  What will be the instructions to the end user on how to take advantage of this change?</p>
<p>Quoting myself, &#8220;Then, as I do the work for real, it gives me an acid test to know if I&#8217;m on the right track. In other words, does the software now work as advertised? A side benefit of this end-first exercise is that it often reveals latent issues and questions for which I have no answers. It also helps me to enumerate any assumptions that I&#8217;ve been making, which perhaps ought to be validated.&#8221;</p>
<p>This is a very much akin to Test-First Development (a.k.a. Test-Driven Development, or TDD for short), of which I am a huge proponent.  I&#8217;d almost say that what I described above is a poor man&#8217;s version of TDD, except that there is no cost to doing TDD.  Unit testing tools are free for the asking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/tdd-solves-the-blank-page-syndrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
