<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>All Wrong</title>
	<atom:link href="http://allwrong.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://allwrong.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 09:27:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='allwrong.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>All Wrong</title>
		<link>http://allwrong.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://allwrong.wordpress.com/osd.xml" title="All Wrong" />
	<atom:link rel='hub' href='http://allwrong.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Quite: If you cannot measure it&#8230;</title>
		<link>http://allwrong.wordpress.com/2011/05/11/quite-if-you-cannot-measure-it/</link>
		<comments>http://allwrong.wordpress.com/2011/05/11/quite-if-you-cannot-measure-it/#comments</comments>
		<pubDate>Wed, 11 May 2011 09:05:06 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1088</guid>
		<description><![CDATA[If you cannot measure it, you cannot improve it. Lord Kelvin<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1088&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p>If you cannot measure it, you cannot improve it. <cite>Lord Kelvin</cite></p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1088/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1088&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/05/11/quite-if-you-cannot-measure-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
		<item>
		<title>Best Practice: Foundations</title>
		<link>http://allwrong.wordpress.com/2011/05/03/best-practice-foundations/</link>
		<comments>http://allwrong.wordpress.com/2011/05/03/best-practice-foundations/#comments</comments>
		<pubDate>Tue, 03 May 2011 19:32:52 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Best Practice]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1086</guid>
		<description><![CDATA[When I became a full-time developer I determined to learn what constitutes best-practice in my profession and to learn to apply it to my practice. Thus far, it has been an interesting and largely enjoyable journey. Of course, I&#8217;ve made some fundamental mistakes on the way. One source of error has been difficulty in determining [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1086&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I became a full-time developer I determined to learn what constitutes best-practice in my profession and to learn to apply it to my practice. Thus far, it has been an interesting and largely enjoyable journey.</p>
<p>Of course, I&#8217;ve made some fundamental mistakes on the way. One source of error has been difficulty in determining what constitutes best practice in the context of the projects I&#8217;m working on. Clearly, best practice in any endevour must be determined by your overall purpose. Today, I came across an <a href="http://blogs.msdn.com/b/ericlippert/archive/2011/04/20/uses-and-misuses-of-implicit-typing.aspx">article</a> by <a href="http://blogs.msdn.com/b/ericlippert/">Eric Lippert</a> that sums up our purpose as well as anything I&#8217;ve come across up to this point:</p>
<blockquote><p>The purpose of code is to create value by solving a business problem.</p></blockquote>
<p>Best practice, then, is that which most effectively enables us to add business value. Not all code adds value in the same way, so best practice will vary between projects.</p>
<p>In the same article, Lippert identifies 3 areas in which code displays fitness for purpose:</p>
<ol>
<li>Good code is code which &#8220;works correctly according to its specification to actually solve the stated problem&#8221;</li>
<li>Good code &#8220;communicates its meaning to the reader who needs to understand its operation&#8221;</li>
<li>Good code &#8220;allows for relatively low-cost modification to solve new problems as the business environment changes&#8221;</li>
</ol>
<p>The relative importance of these 3 areas can vary between projects. A quick throw-away script that is used by a single develpoper needs to be functional but less emphasis can be placed on modification and readability. On the other hand, an application like Microsoft Word will be worked on by many developers and maintained through numerous development cycles. As such, readability and maintainability need to be emphasised as much as correct fuctionality.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1086/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1086&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/05/03/best-practice-foundations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server: Disable All Constraints</title>
		<link>http://allwrong.wordpress.com/2011/05/03/sql-server-2005-disable-all-constraints/</link>
		<comments>http://allwrong.wordpress.com/2011/05/03/sql-server-2005-disable-all-constraints/#comments</comments>
		<pubDate>Tue, 03 May 2011 11:00:06 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1081</guid>
		<description><![CDATA[To disable all constraints on all tables in a database: To enable all constraints on all tables in a database:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1081&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To disable all constraints on all tables in a database:</p>
<p><pre class="brush: sql;">

EXEC sp_msforeachtable &quot;ALTER TABLE ? NOCHECK CONSTRAINT all&quot;

</pre></p>
<p>To enable all constraints on all tables in a database:</p>
<p><pre class="brush: sql;">

exec sp_msforeachtable @command1=&quot;print '?'&quot;, @command2=&quot;ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all&quot;

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1081/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1081&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/05/03/sql-server-2005-disable-all-constraints/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
		<item>
		<title>Book Summary: Practices of an Agile Developer</title>
		<link>http://allwrong.wordpress.com/2011/04/27/book-summary-practices-of-an-agile-developer/</link>
		<comments>http://allwrong.wordpress.com/2011/04/27/book-summary-practices-of-an-agile-developer/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 16:22:06 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1050</guid>
		<description><![CDATA[Review Note: This page is an ongoing project&#8230; Below is my summary of &#8220;Practices of an Agile Developer: Working in the Real World&#8221; by Venkat Subramaniam and Andy Hunt. In my view this is a 4-star book, well worth reading in its entirety. Aside from introductory and closing chapters, each chapter of the book describes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1050&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><a href="http://allwrong.files.wordpress.com/2011/04/book_poad.jpg"><img class="size-medium wp-image-1064 alignright" title="Book_PoAD" src="http://allwrong.files.wordpress.com/2011/04/book_poad.jpg?w=240&#038;h=240" alt="" width="240" height="240" /></a>Review</h2>
<p><em>Note: This page is an ongoing project&#8230;</em></p>
<p>Below is my summary of &#8220;Practices of an Agile Developer: Working in the Real World&#8221; by Venkat Subramaniam and Andy Hunt. In my view this is a 4-star book, well worth reading in its entirety.</p>
<p>Aside from introductory and closing chapters, each chapter of the book describes one of 45 practices that are important in achieving an Agile development environment (one reviewer <a href="http://www.codesqueeze.com/book-review-practices-of-an-agile-developer/">suggested</a> it be renamed, &#8220;45 Habits of Highly Effective Developers&#8221;)</p>
<p>The thing I like most about the book is the <em>emotional awareness</em> of the authors. They recognise that development is as much an emotional experience as it is a technical one, and that communicating good practice needs to address the readers&#8217; emotional needs as well as their practical ones. This applies to both the presentation and content of each chapter. As a result, I felt good about reading this book, and I feel good about trying out the espoused practices.</p>
<h4>Presentation</h4>
<p>The language, typography and layout make it an easy read.</p>
<p>The subdivision of the book into 45 practices means that:</p>
<ul>
<li>It can be read in digestible chunks</li>
<li>It is possible to dip-in</li>
<li>It makes a good reference book</li>
</ul>
<h4>Content</h4>
<p>The chapters on each of the practices includes:</p>
<ul>
<li>A practice number and title, for easy reference.</li>
<li>An explicit statement of the reasons why we might resist the practice described (the Devil&#8217;s temptation)</li>
<li>A discussion that explains the rational behind the practice and how to apply it practically, typically backed up by real-world examples</li>
<li>A summary of the key message of the chapter (the Angel&#8217;s advice)</li>
<li>The emotional outcome of following the practices described (What it Feels Like). This encourages emotional buy-in.</li>
<li>Notes on how not maintain perspective (&#8220;Keeping Your Balance&#8221;)</li>
</ul>
<h2>Beginning Agility</h2>
<h3>Work for Outcome (Page 12) &#8211; PoAD#P1</h3>
<h4>Temptation</h4>
<p>Prioritise finding the culprit over resolving the problem</p>
<h4>Problem</h4>
<ul>
<li>Reactive and defensive people are unproductive</li>
<li>Assigning blame can make the situation worse</li>
</ul>
<h4>Context</h4>
<ul>
<li>It is rare that one person is entirely to blame</li>
<li>Everyone makes mistakes (unless they take no risks)</li>
<li>A person&#8217;s misunderstanding / ignorance/mistake often reveals an area for team development</li>
</ul>
<h4>Attitude</h4>
<p>Outcome is more important than taking credit / apportioning blame</p>
<blockquote><p>Blame doesn&#8217;t fix bugs</p></blockquote>
<h4>Solution</h4>
<p>Offer to help.</p>
<blockquote><p>Be part of the solution, not part of the problem</p></blockquote>
<p>Don&#8217;t argue about it, fix it.</p>
<h4>Outcomes</h4>
<ul>
<li>Safe to admit ignorance</li>
<li>Mistakes are learning opportunities</li>
<li>Teamwork</li>
</ul>
<h4>Balance</h4>
<ul>
<li>Remove bad apples from the bunch</li>
<li>Remove yourself from a bad team</li>
</ul>
<h4>Thoughts</h4>
<ul>
<li>Credit-whoring can be just as bad as apportioning blame</li>
<li>Both the fear of and actuality of blame / credit whoring is damaging productivity</li>
</ul>
<h3>Quick Fixes Become Quicksand (Page 15) &#8211; PoAD#P2</h3>
<h4>Temptation</h4>
<p>Make a quick fix to code you don&#8217;t really understand</p>
<h4>Problem</h4>
<p>Clarity of code goes down</p>
<p>Accumulation of quick fixes become &#8220;quicksand&#8221;</p>
<blockquote><p>You can’t possibly be agile with that kind of baggage</p></blockquote>
<h4>Attitude</h4>
<p>Long term code clarity is more important than short-term fixes.</p>
<h4>Solution</h4>
<ul>
<li>Get a good understanding of the overall architecture and design</li>
<li>Understand the code you modify</li>
<li>Avoid quick hacks</li>
<li><strong></strong> Invest in code clarity</li>
</ul>
<blockquote><p>Fix the problem, not the symptom</p></blockquote>
<h4>Tools</h4>
<ul>
<li>Don&#8217;t code in isolation (e.g. use code reviews)</li>
<li>Unit testing</li>
</ul>
<h4>Outcomes</h4>
<ul>
<li>Clean code</li>
<li>No areas of untouchable code</li>
<li>Developers have a general working knowledge of the code base</li>
</ul>
<blockquote><p>There are no dark corners in the project</p></blockquote>
<h4>Balance</h4>
<ul>
<li>You don&#8217;t need to become an expert at everything</li>
<li>Larger systems are rarely understood by one individual</li>
<li>If the code can&#8217;t be understood by the team, it is too hard to maintain &#8211; even for the original author</li>
</ul>
<h4>Thoughts</h4>
<p>Quick fixes can be bad news in the short term, too. The project was a static data loader that threw an exception. I made a small change to a piece of code I didn&#8217;t fully understand. The consequence was the the data in the wrong version of the database was overwritten.</p>
<h3>Criticize Ideas, Not People (Page 18) &#8211; PoAD#P3<strong></strong></h3>
<h4>Temptation</h4>
<p>Making it about <em>who</em> is right rather than <em>what</em> is right.</p>
<h4>Problem</h4>
<p>Criticism:</p>
<ul>
<li>Does nothing to enhance understanding</li>
<li>Suppresses innovation</li>
<li>Makes people unhappy</li>
</ul>
<h4>Context</h4>
<ul>
<li>Everyone has bad ideas</li>
<li>Nothing is perfect &#8211; there is only &#8220;better&#8221;</li>
<li>Bad ideas can stimulate good ones</li>
<li>Everyone starts somewhere</li>
<li>Compromises are inevitable</li>
</ul>
<p><strong>Attitude</strong></p>
<p>Focus on the best solution, not the best person.</p>
<blockquote><p>Criticize ideas, not people</p></blockquote>
<h4>Solution</h4>
<ul>
<li>Ask open questions to reveal flaws and solutions</li>
<li>Don&#8217;t be afraid of criticism</li>
<li>When you see a potential problem, realistically ask how often a problem actually occurs</li>
<li>Support the decision</li>
</ul>
<h4>Tools for Overcoming Indecision</h4>
<ul>
<li>Set a deadline</li>
<li>Argue for the opposite</li>
<li>Mediation</li>
</ul>
<h4>Outcomes</h4>
<ul>
<li>Freedom to explore ideas</li>
<li>Ideas can be rejected without hurt feelings</li>
<li>Imperfect ideas can be adopted without guilt</li>
</ul>
<h4>Balance</h4>
<ul>
<li>Make sure everyone agrees on what &#8220;best&#8221; means. Users and developers often disagree</li>
<li>Sometimes you have to accept the least worst solution</li>
</ul>
<h3>Damn the Torpedoes, Go Ahead (Page 23) &#8211; PoAD#P4<strong></strong></h3>
<h4>Temptation</h4>
<p>Ignore important issues to avoid uncomfortable situations</p>
<h4>Attitudes</h4>
<p>Courage to do what is right</p>
<h4>Solution</h4>
<ul>
<li>Be courageous</li>
<li>Communicate truth</li>
<li>Do the right thing</li>
</ul>
<p>Admiral David Farragut:</p>
<blockquote><p>Damn the torpedoes, full speed ahead!</p></blockquote>
<h4>Outcomes</h4>
<ul>
<li>Short-term discomfort</li>
<li>Relief, not dread</li>
<li>Festering problems addressed</li>
</ul>
<h4>Balance</h4>
<ul>
<li>If everyone else disagrees, you may be explaining it wrong &#8211; or just wrong</li>
<li>Impatience is not courage &#8211; take time to understand why things are the way they are</li>
</ul>
<h2>Feeding Agility</h2>
<h3>Keep Up with Change (Page 28) &#8211; PoAD#P5</h3>
<p><strong>Keep up with changing technology</strong>. You don’t have to become an expert at everything, but stay aware of where<br />
the industry is headed, and plan your career and projects accordingly.</p>
<h3>Invest in Your Team (Page 31) &#8211; PoAD#P6</h3>
<p><strong>Raise the bar for you and your team</strong>. Use brown-bag sessions to increase everyone’s knowledge and skills and help bring people together. Get the team excited about technologies or techniques that will benefit your project.</p>
<h3>Know When to Unlearn (Page 34) &#8211; PoAD#P7</h3>
<p><strong>Learn the new; unlearn the old</strong>. When learning a new technology, unlearn any old habits that might hold you back.</p>
<h3>Question Until You Understand (Page 37) &#8211; PoAD#P8</h3>
<p><strong>Keep asking Why</strong>. Don’t just accept what you’re told at face value. Keep questioning until you understand the root of<br />
the issue.</p>
<h3>Feel the Rhythm (Page 40) &#8211; PoAD#P9</h3>
<p><strong>Tackle tasks before they bunch up</strong>. It’s easier to tackle common recurring tasks when you maintain steady, repeatable intervals between events.</p>
<h2>Delivering What Users Want</h2>
<h3>Let Customers Make Decisions (Page 45) &#8211; PoAD#P10</h3>
<p><strong>Let your customers decide</strong>. Developers, managers, or business analysts shouldn’t make business-critical decisions. Present details to business owners in a language they can understand, and let them make the decision.</p>
<h3>Let Design Guide, Not Dictate (Page 48) &#8211; PoAD#P11</h3>
<p><strong>A good design is a map; let it evolve</strong>. Design points you in the right direction. It’s not the territory itself; it shouldn’t dictate the specific route. Don’t let the design (or the designer) hold you hostage.</p>
<h3>Justify Technology Use (Page 52) &#8211; PoAD#P12</h3>
<p><strong>Choose technology based on need.</strong> Determine your needs first, and then evaluate the use of technologies for those specific problems. Ask critical questions about the use of any technology, and answer them genuinely.</p>
<h3>Keep It Releasable (Page 55) &#8211; PoAD#P13</h3>
<p><strong>Keep your project releasable at all times</strong>. Ensure that the project is always compilable, runnable, tested, and ready to deploy at a moment’s notice.</p>
<h3>Integrate Early, Integrate Often (Page 58) &#8211; PoAD#P14</h3>
<p><strong>Integrate early, integrate often</strong>. Code integration is a major source of risk. To mitigate that risk, start integration early and continue to do it regularly.</p>
<h3>Automate Deployment Early (Page 61) &#8211; PoAD#P15</h3>
<p>Deploy your application automatically from the start. Use that deployment to install the application on arbitrary machines with different configurations to test dependencies. QA should test the deployment as well as your application.</p>
<h3>Get Frequent Feedback Using Demos (Page 64) &#8211; PoAD#P16</h3>
<p><strong>Develop in plain sight</strong>. Keep your application in sight (and in the customers’ mind) during development. Bring customers together and proactively seek their feedback using demos every week or two.</p>
<h3>Use Short Iterations, Release in Increments (Page 69) &#8211; PoAD#P17</h3>
<p><strong>Develop in increments</strong>. Release your product with minimal, yet usable, chunks of functionality. Within the development of each increment, use an iterative cycle of one to four weeks or so.</p>
<h3>Fixed Prices Are Broken Promises (Page 73) &#8211; PoAD#P18</h3>
<p><strong>Estimate based on real work</strong>. Let the team actually work on the current project, with the current client, to get realistic estimates. Give the client control over their features and budget.</p>
<h2>Agile Feedback</h2>
<h3>Put Angels on Your Shoulders (Page 78) &#8211; PoAD#P19</h3>
<p><strong>Use automated unit tests</strong>. Good unit tests warn you about problems immediately. Don’t make any design or code changes without solid unit tests in place.</p>
<h3>Use It Before You Build It (Page 82) &#8211; PoAD#P20</h3>
<p><strong>Use it before you build it</strong>. Use Test Driven Development as a design tool. It will lead you to a more pragmatic and simpler design.</p>
<h3>Different Makes a Difference (Page 87) &#8211; PoAD#P21</h3>
<p><strong>Different makes a difference</strong>. Run unit tests on each supported platform and environment combination, using continuous integration tools. Actively find problems before they find you.</p>
<h3>Automate Acceptance Testing (Page 90) &#8211; PoAD#P22</h3>
<p><strong>Create tests for core business logic</strong>. Have your customers verify these tests in isolation, and exercise them automatically as part of your general test runs.</p>
<h3>Measure Real Progress (Page 93) &#8211; PoAD#P23</h3>
<p><strong>Measure how much work is left</strong>. Don’t kid yourself — or your team — with irrelevant metrics. Measure the backlog of work to do.</p>
<h3>Listen to Users (Page 96) &#8211; PoAD#P24</h3>
<p><strong>Every complaint holds a truth</strong>. Find the truth, and fix the real problem.</p>
<h2>Agile Coding</h2>
<h3>Program Intently and Expressively (Page 100) &#8211; PoAD#P25</h3>
<p><strong>Write code to be clear, not clever</strong>. Express your intentions clearly to the reader of the code. Unreadable code isn’t clever.</p>
<h3>Communicate in Code (Page 105) &#8211; PoAD#P26</h3>
<p><strong>Comment to communicate</strong>. Document code using wellchosen, meaningful names. Use comments to describe its purpose and constraints. Don’t use commenting as a substitute for good code.</p>
<h3>Actively Evaluate Trade-Offs (Page 110) &#8211; PoAD#P27</h3>
<p><strong>Actively evaluate trade-offs</strong>. Consider performance, convenience, productivity, cost, and time to market. If performance is adequate, then focus on improving the other factors. Don’t complicate the design for the sake of perceived performance or elegance.</p>
<h3>Code in Increments (Page 113) &#8211; PoAD#P28</h3>
<p><strong>Write code in short edit/build/test cycles</strong>. It’s better than coding for an extended period of time. You’ll create code that’s clearer, simpler, and easier to maintain.</p>
<h3>Keep It Simple (Page 115) &#8211; PoAD#P29</h3>
<p><strong>Develop the simplest solution that works</strong>. Incorporate patterns, principles, and technology only if you have a compelling reason to use them.</p>
<h3>Write Cohesive Code (Page 117) &#8211; PoAD#P30</h3>
<p><strong>Keep classes focused and components small</strong>. Avoid the temptation to build large classes or components or miscellaneous catchall classes.</p>
<h3>Tell, Don’t Ask (Page 121) &#8211; PoAD#P31</h3>
<p><strong>Tell, don’t ask</strong>. Don’t take on another object’s or component’s job. Tell it what to do, and stick to your own job.</p>
<h3>Substitute by Contract (Page 124) &#8211; PoAD#P32</h3>
<p><strong>Extend systems by substituting code</strong>. Add and enhance features by substituting classes that honor the interface contract. Delegation is almost always preferable to inheritance.</p>
<h2>Agile Debugging</h2>
<h3>Keep a Solutions Log (Page 129) &#8211; PoAD#P33</h3>
<p><strong>Maintain a log of problems and their solutions</strong>. Part of fixing a problem is retaining details of the solution so you can find and apply it later.</p>
<h3>Warnings Are Really Errors (Page 132) &#8211; PoAD#P34</h3>
<p><strong>Treat warnings as errors</strong>. Checking in code with warnings is just as bad as checking in code with errors or code that fails its tests. No checked-in code should produce any warnings from the build tools.</p>
<h3>Attack Problems in Isolation (Page 136) &#8211; PoAD#P35</h3>
<p><strong>Attack problems in isolation</strong>. Separate a problem area from its surroundings when working on it, especially in a large application.</p>
<h3>Report All Exceptions (Page 139) &#8211; PoAD#P36</h3>
<p><strong>Handle or propagate all exceptions</strong>. Don’t suppress them, even temporarily. Write your code with the expectation that things will fail.</p>
<h3>Provide Useful Error Messages (Page 141) &#8211; PoAD#P37</h3>
<p><strong>Present useful error messages</strong>. Provide an easy way to find the details of errors. Present as much supporting detail as you can about a problem when it occurs, but don’t bury the user with it.</p>
<h2>Agile Collaboration</h2>
<h3>Schedule Regular Face Time (Page 148) &#8211; PoAD#P38</h3>
<p><strong>Use stand-up meetings</strong>. Stand-up meetings keep the team on the same page. Keep the meeting short, focused, and intense.</p>
<h3>Architects Must Write Code (Page 152) &#8211; PoAD#P39</h3>
<p><strong>Good design evolves from active programmers</strong>. Real insight comes from active coding. Don’t use architects who don’t code—they can’t design without knowing the realities of your system.</p>
<h3>Practice Collective Ownership (Page 155) &#8211; PoAD#P40</h3>
<p><strong>Emphasize collective ownership of code</strong>. Rotate developers across different modules and tasks in different areas of the system.</p>
<h3>Be a Mentor (Page 157) &#8211; PoAD#P41</h3>
<p><strong>Be a mentor</strong>. There’s fun in sharing what you know—you gain as you give. You motivate others to achieve better results. You improve the overall competence of your team.</p>
<h3>Allow People to Figure It Out (Page 160) &#8211; PoAD#P42</h3>
<p><strong>Give others a chance to solve problems</strong>. Point them in the right direction instead of handing them solutions. Everyone can learn something in the process.</p>
<h3>Share Code Only When Ready (Page 162) &#8211; PoAD#P43</h3>
<p><strong>Share code only when ready</strong>. Never check in code that’s not ready for others. Deliberately checking in code that doesn’t compile or pass its unit tests should be considered<br />
an act of criminal project negligence.</p>
<h3>Review Code (Page 165) &#8211; PoAD#P44</h3>
<p><strong>Review all code</strong>. Code reviews are invaluable in improving the quality of the code and keeping the error rate low. If done correctly, reviews can be practical and effective. Review code after each task, using different developers.</p>
<h3>Keep Others Informed (Page 168) &#8211; PoAD#P45</h3>
<h4>Temptation</h4>
<p>Focus on getting the job done. If people want a status update, they&#8217;ll ask.</p>
<h4>Problem</h4>
<ul>
<li>Trust diminishes</li>
<li>You won&#8217;t get help</li>
<li>Customers can&#8217;t re-prioritize</li>
<li>Interruptions for status updates</li>
</ul>
<h4>Attitude</h4>
<p>Keep others informed</p>
<h4>Solution</h4>
<ul>
<li>Tell people, don&#8217;t wait for them to ask</li>
<li>Deliver bad news early: don&#8217;t give people unpleasant surprises</li>
<li>Publish designs, cool ideas, research, status etc.</li>
</ul>
<blockquote><p>Stay head’s up, not head down</p></blockquote>
<h4>Tools</h4>
<ul>
<li>Email</li>
<li>Sticky notes</li>
<li>Phone calls</li>
<li>Status charts</li>
<li>Blog</li>
<li>Wiki</li>
<li>Daily stand-up</li>
</ul>
<h4>Outcomes</h4>
<ul>
<li>People don&#8217;t pester you for status updates</li>
</ul>
<h4>Balance</h4>
<ul>
<li>Know your audience, level appropriately</li>
<li>Don&#8217;t let communication efforts get in the way of work progress</li>
</ul>
<h2>Other Summaries and Reviews</h2>
<ul>
<li><a href="http://www.pshymorphic.com/files/CT-SPIN%2029%20-%20NioCAD%20-%20Practices%20of%20an%20Agile%20Developer.pdf">Jan Pool&#8217;s Summary</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1050/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1050/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1050/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1050/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1050/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1050/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1050/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1050/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1050&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/04/27/book-summary-practices-of-an-agile-developer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>

		<media:content url="http://allwrong.files.wordpress.com/2011/04/book_poad.jpg?w=300" medium="image">
			<media:title type="html">Book_PoAD</media:title>
		</media:content>
	</item>
		<item>
		<title>Prince 2 Notes: Change</title>
		<link>http://allwrong.wordpress.com/2011/04/26/prince-2-notes-change/</link>
		<comments>http://allwrong.wordpress.com/2011/04/26/prince-2-notes-change/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 19:57:28 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Prince2]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1048</guid>
		<description><![CDATA[Issues and Changes Change is inevitable Projects need a systematic method for managing change Change management is a continual activity Issue: Deffinition An issue is an event that was not planned requires management action Issues can be raised by anyone Types of Issues Off Specification (Off Spec): any product that is missing / not meeting agreed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1048&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Issues and Changes</h2>
<ul>
<li>Change is inevitable</li>
</ul>
<p>Projects need a systematic method for managing change</p>
<p>Change management is a continual activity</p>
<h2>Issue: Deffinition</h2>
<p>An issue is an event that was</p>
<ul>
<li>not planned</li>
<li>requires management action</li>
</ul>
<p>Issues can be raised by anyone</p>
<h2>Types of Issues</h2>
<ol>
<li>Off Specification (Off Spec): any product that is missing / not meeting agreed specification</li>
<li>Request for Change (RfC): proposed change from baseline</li>
<li>Problem / Concern (P/C): any other problem / concern / query / suggestion</li>
</ol>
<h2>Change Control</h2>
<p>Systematic change control keeps project:</p>
<ul>
<li>Responsive to change</li>
<li>Under control</li>
</ul>
<p>Ensures change is</p>
<ul>
<li>Authorised by appropriate authority</li>
<li>Considered in relation to baseline</li>
</ul>
<p>Procedures ensure that issues and changes are:</p>
<ul>
<li>Identified</li>
<li>Assessed</li>
<li>Approved / rejected</li>
<li>Implemented</li>
</ul>
<h2>Configuration Management</h2>
<p>Products are versioned (i.e. kept in configuration management)</p>
<p>Mechanism to track configuration:</p>
<ul>
<li>Creation</li>
<li>Maintenance</li>
<li>Control</li>
</ul>
<h2>Configuration Item</h2>
<p>Something subject to configuration management, such as:</p>
<ul>
<li>A product</li>
<li>A component of a product</li>
<li>A set of products that form a release</li>
</ul>
<h2>Release</h2>
<p>A set of products that are managed, tested and deployed as a unit</p>
<h2>Management Products (Documents)</h2>
<ul>
<li>Configuration Management Strategy</li>
<li>Configuration Item Records</li>
<li>Product Status Accounts</li>
<li>Daily Log</li>
<li>Issue Register</li>
<li>Issue Reports</li>
</ul>
<h3>Configuration Management Strategy</h3>
<p>Facilitates impact assessments (relationships between products)</p>
<p>Maintains product baselines</p>
<p>Based on corporate or programme strategy where these exist</p>
<p>Defines:</p>
<ul>
<li>How:</li>
<ul>
<li>Management procedure</li>
<li>Issue / Change control procedure</li>
<ul>
<li>Identify</li>
<li>Propose</li>
<li>Decide</li>
<li>Implement</li>
</ul>
</ul>
<li>What: Tools and techniques</li>
<li>Why: Records and Reporting</li>
<li>When: Timing</li>
<li>Who: Roles and responsibilities</li>
</ul>
<p>Defines levels:</p>
<ul>
<li>Priority</li>
<li>Severity</li>
</ul>
<p>e.g. MoSCoW</p>
<h4>Change Authority</h4>
<p>Who has responsibility at each severity level.eg. Project Board, PM, etc.</p>
<h4>Change Budget</h4>
<p>Funding for the costs of change</p>
<p>Managed by Change Authority</p>
<p>Limits can be specified for:</p>
<ul>
<li>Costs of single change</li>
<li>Total spend on change in stage</li>
</ul>
<h3>Configuration Item Records</h3>
<p>Include information on:</p>
<ul>
<li>Status</li>
<li>Version</li>
<li>Variant</li>
<li>Relationships between items</li>
</ul>
<h3>Product Status Account</h3>
<p>State of products</p>
<h3>Daily Log</h3>
<p>Records problems and concerns that can be handled by PM informally</p>
<p>Can be transferred to Issue Register if required</p>
<h3>Issue Register</h3>
<p>Contains information on issues managed formally</p>
<p>Monitored by PM regularly</p>
<h3>Issue Report</h3>
<p>Only required for formal issues, these include:</p>
<ul>
<li>Description</li>
<li>Impact assessment</li>
<li>Recommendations</li>
</ul>
<h2>Configuration Management Procedure</h2>
<h3>Planning</h3>
<ul>
<li>Decide level of configuration management required</li>
<li>And how that level will be achieved</li>
</ul>
<h3>Identification</h3>
<p>All components of products at level of control</p>
<h3>Control</h3>
<p>Ability to:</p>
<ul>
<li>Approve products</li>
<li>Baseline products (old baselines are archived, not deleted)</li>
<li>Ensure changes are authorised by appropriate authorities</li>
</ul>
<p>Products include:</p>
<ul>
<li>Management products (inc documentation)</li>
<li>Specialist products</li>
</ul>
<h3>Status Accounting</h3>
<p>Reporting on current and historical data re: product</p>
<h3>Verification and Audit</h3>
<p>Two purposes:</p>
<ul>
<li>Comparing actual and authorised status of products.</li>
<li>Check procedures in Configuration Management Strategy are followed</li>
</ul>
<p>Occur at end of stage and end of project</p>
<h2>Issue and Change Control Procedure</h2>
<p>Defined by IP process</p>
<p>Reviewed and updated during MSB process</p>
<h3>Capture</h3>
<ul>
<li>Type of Issue &#8211; formal / informal</li>
<li>Determine severity / priority</li>
<li>Level of authority</li>
<li>Formal issues -&gt; Issue Register</li>
<li>Issue Report created</li>
</ul>
<h3>Examine</h3>
<ol>
<li>Impact of analysis cost</li>
<li>Impact analysis on project objectives / business case / project risk profile</li>
<li>Impact on supplier / user / business</li>
<li>Update Issue Register / Issue Report</li>
</ol>
<h3>Propose</h3>
<ol>
<li>Identify options</li>
<li>Evaluate options</li>
<li>Recommend options</li>
<li>Risk</li>
<li>Exception Report?</li>
</ol>
<h3>Decide</h3>
<h4>RfC</h4>
<ul>
<li>Approve</li>
<li>Reject</li>
<li>Request info</li>
<li>Defer</li>
<li>Escalate</li>
</ul>
<h4>Off-Spec</h4>
<ul>
<li>Grant Concession</li>
<li>Resolve</li>
<li>Defer</li>
<li>Request info</li>
<li>Escalate</li>
</ul>
<h4>Problem / concern</h4>
<ul>
<li>Provide guidance</li>
<li>Escalate</li>
</ul>
<h3>Implement</h3>
<ul>
<li>Take corrective action</li>
<li>Create an exception plan</li>
</ul>
<p>Update issue register</p>
<h1>Budget Options</h1>
<p>Some changes impact budget</p>
<h2>Illegitimate Options</h2>
<p>Using Tolerance to fund Changes</p>
<h2>Legitimate Options</h2>
<p>Using Change Budget</p>
<p>Increase project cost</p>
<p>Reducing project scope</p>
<h2></h2>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1048/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1048/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1048/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1048/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1048/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1048/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1048/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1048/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1048&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/04/26/prince-2-notes-change/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
		<item>
		<title>Best Practices: Variables</title>
		<link>http://allwrong.wordpress.com/2011/04/18/best-practices-variables/</link>
		<comments>http://allwrong.wordpress.com/2011/04/18/best-practices-variables/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 15:27:57 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Progamming]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1044</guid>
		<description><![CDATA[Notes from Code Complete 2: Chapter 10 Date Types Know your data types (10.1) Declaration and Naming Declare all variables (turn off implicit declarations) (10.2) Follow naming conventions (10.2) Initialization Initialize each variable as it&#8217;s declared (10.3) Declare and define each variable close to where it&#8217;s first used (10.3) Initialize working memory at the beginning [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1044&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Notes from Code Complete 2: Chapter 10</p>
<h3>Date Types</h3>
<ul>
<li>Know your data types (10.1)</li>
</ul>
<h3>Declaration and Naming</h3>
<ul>
<li>Declare all variables (turn off implicit declarations) (10.2)</li>
<li>Follow naming conventions (10.2)</li>
</ul>
<h3>Initialization</h3>
<ul>
<li>Initialize each variable as it&#8217;s declared (10.3)</li>
<li>Declare and define each variable close to where it&#8217;s first used (10.3)</li>
<li>Initialize working memory at the beginning of your program</li>
<li>Use the compiler setting that automatically initializes all variables</li>
<li>Initialize a class&#8217;s member data in its constructor</li>
<li>Pay special attention to counters and accumulators &#8211; ensure that they are initialized properly and, if necessary, reinitialized each time they are used</li>
<li>Check the need for reinitialization</li>
<li>Check that variables are reinitialized properly in code that&#8217;s executed repeatedly</li>
<li>Initialize named constants once; initialize variables with executable code</li>
<li>Check input parameters for validity</li>
<li>Use a memory-access checker to check for bad pointers</li>
<li>Don&#8217;t assign a value to a variable until just before the value is used</li>
<li>Use final or const when possible</li>
<li>Use named constants (avoid magic numbers)</li>
<li>Strike a conscious balance between the flexibility of late binding and the increased complexity associated with late binding</li>
</ul>
<h3> Scope</h3>
<ul>
<li>Ensure that variables have the smallest scope possible</li>
<li>Develop the habit of declaring and initializing all data right before it&#8217;s used</li>
<li>Localize References to Variables</li>
<li>Keep Variables &#8220;Live&#8221; for as Short a Time as Possible</li>
<li>Initialize variables used in a loop immediately before the loop rather than back at the beginning of the routine containing the loop</li>
<li>Group related statements</li>
<li>Break groups of related statements into separate routines</li>
<li>Begin with most restricted visibility, and expand the variable&#8217;s scope only if necessary</li>
</ul>
<h3>Purpose</h3>
<ul>
<li>Use each variable for one purpose only</li>
<li>Avoid variables with hidden meanings</li>
<li>Make sure that all declared variables are used</li>
</ul>
<h3>Persistence</h3>
<ul>
<li>Write code that assumes data isn&#8217;t persistent (10.5)</li>
</ul>
<h3>Release</h3>
<ul>
<li>Set variables to &#8220;unreasonable values&#8221; when you&#8217;re through with them (10.6)</li>
</ul>
<h3>General</h3>
<ul>
<li>Enable and pay attention to compiler warnings</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1044/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1044/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1044/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1044/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1044/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1044/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1044/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1044/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1044&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/04/18/best-practices-variables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio Extension: Browse Current Project</title>
		<link>http://allwrong.wordpress.com/2011/03/30/visual-studio-extension-browse-current-project/</link>
		<comments>http://allwrong.wordpress.com/2011/03/30/visual-studio-extension-browse-current-project/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 14:56:59 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[vs2010]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1029</guid>
		<description><![CDATA[I&#8217;ve just published my first Visual Studio Extension. It is a very simple one-command extension that allows you to view the contents of the folder that contains the current project in the Visual Studio Browser. At the moment, only Visual Studio 2010 is supported. Instructions for Use To view open the browser on the project&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1029&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just published <a href="http://visualstudiogallery.msdn.microsoft.com/e4904625-8e2e-4b3c-b3a1-6607d99e1c97?SRC=Home">my first Visual Studio Extension</a>. It is a very simple one-command extension that allows you to view the contents of the folder that contains the current project in the Visual Studio Browser. At the moment, only Visual Studio 2010 is supported.</p>
<h3>Instructions for Use</h3>
<p>To view open the browser on the project&#8217;s folder, just click on the button in the Solution Explorer&#8217;s toolbar. The button is only visible when you have a solution loaded in Visual Studio.</p>
<p><a href="http://allwrong.files.wordpress.com/2011/03/browsecurrentprojectbutton1.png"></a><a href="http://allwrong.files.wordpress.com/2011/03/browsecurrentprojectbutton2.png"><img class="aligncenter size-full wp-image-1035" title="BrowseCurrentProjectButton" src="http://allwrong.files.wordpress.com/2011/03/browsecurrentprojectbutton2.png?w=450" alt=""   /></a></p>
<p>The contents of the folder that contains the current project will be displayed in Visual Studio. That&#8217;s it!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1029/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1029&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/03/30/visual-studio-extension-browse-current-project/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>

		<media:content url="http://allwrong.files.wordpress.com/2011/03/browsecurrentprojectbutton2.png" medium="image">
			<media:title type="html">BrowseCurrentProjectButton</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio Fonts and Colors: Version 2</title>
		<link>http://allwrong.wordpress.com/2011/03/28/visual-studio-fonts-and-colors-version-2/</link>
		<comments>http://allwrong.wordpress.com/2011/03/28/visual-studio-fonts-and-colors-version-2/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 16:38:34 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1023</guid>
		<description><![CDATA[Some time ago I wrote about my chosen colour scheme for Visual Studio.  I&#8217;ve updated it several times since, so I&#8217;ve uploaded the latest version to StudioStyles. It looks like this: Unfortunately, StudioStyles doesn&#8217;t support all the styles for VB.Net, so you&#8217;ll have to tweak it a bit if you want VB.Net goodness.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1023&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some time ago <a href="http://allwrong.wordpress.com/2008/06/05/visual-studio-fonts-and-colors/">I wrote</a> about my chosen colour scheme for Visual Studio.  I&#8217;ve updated it several times since, so I&#8217;ve uploaded the latest version to <a href="http://studiostyl.es/users/1753">StudioStyles</a>. It looks like this:</p>
<p style="text-align:left;"><a href="http://allwrong.files.wordpress.com/2011/03/vsstyle_v21.png"><img class="aligncenter size-full wp-image-1025" title="vsstyle_v2" src="http://allwrong.files.wordpress.com/2011/03/vsstyle_v21.png?w=450&#038;h=316" alt="" width="450" height="316" /></a></p>
<p style="text-align:left;">Unfortunately, StudioStyles doesn&#8217;t support all the styles for VB.Net, so you&#8217;ll have to tweak it a bit if you want VB.Net goodness.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1023/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1023&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/03/28/visual-studio-fonts-and-colors-version-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>

		<media:content url="http://allwrong.files.wordpress.com/2011/03/vsstyle_v21.png" medium="image">
			<media:title type="html">vsstyle_v2</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server: Drop all Foreign Keys that Reference a Table</title>
		<link>http://allwrong.wordpress.com/2011/03/17/sql-server-drop-all-foreign-keys-that-reference-a-table/</link>
		<comments>http://allwrong.wordpress.com/2011/03/17/sql-server-drop-all-foreign-keys-that-reference-a-table/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 11:44:42 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1013</guid>
		<description><![CDATA[Introduction Before you drop a table in SQL Server, you must first drop all the foreign keys that reference that table. The following SQL scripts may help with this task. Step 1:  Run the following to create a Stored Procedure that will perform the drop: Step 2: Run the following to drop all FKs that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1013&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Before you drop a table in SQL Server, you must first drop all the foreign keys that reference that table. The following SQL scripts may help with this task.</p>
<h3>Step 1:  Run the following to create a Stored Procedure that will perform the drop:</h3>
<p><pre class="brush: sql;">
CREATE PROCEDURE [dbo].[_dropFKs]
   @tableName nvarchar(max)
AS
BEGIN
   DECLARE @sql nvarchar(MAX)
   WHILE EXISTS
   (
      SELECT
         f.name AS ForeignKey,
         OBJECT_NAME(f.parent_object_id) AS TableName,
         COL_NAME(fc.parent_object_id,
         fc.parent_column_id) AS ColumnName,
         OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName,
         COL_NAME(fc.referenced_object_id,
         fc.referenced_column_id) AS ReferenceColumnName
      FROM
         sys.foreign_keys AS f
      INNER JOIN
         sys.foreign_key_columns AS fc ON f.OBJECT_ID = fc.constraint_object_id
      WHERE
         OBJECT_NAME (f.referenced_object_id) = @tableName
   )
   BEGIN
      SELECT @sql =
         'ALTER TABLE ' + OBJECT_NAME (f.parent_object_id) + ' DROP CONSTRAINT ' + f.name + ''
      FROM
         sys.foreign_keys AS f
      INNER JOIN
         sys.foreign_key_columns AS fc ON f.OBJECT_ID = fc.constraint_object_id
      WHERE
         OBJECT_NAME (f.referenced_object_id) = @tableName

      PRINT @sql

      EXEC sp_executesql @sql
   END
END
GO
</pre></p>
<h3>Step 2:  Run the following to drop all FKs that reference the target table:</h3>
<p><pre class="brush: sql;">
EXEC _dropFKs 'TargetTableName'
</pre></p>
<h3>Step 3:  Run the following to delete the Stored Procedure that was created in step 1:</h3>
<p><pre class="brush: sql;">
IF EXISTS (
   SELECT *
   FROM sysobjects
   WHERE id = object_id(N'[dbo].[_dropFKs]')
   AND OBJECTPROPERTY(id, N'IsProcedure') = 1
)
BEGIN
   DROP PROCEDURE [dbo].[_dropFKs]
END
GO
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1013/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1013&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/03/17/sql-server-drop-all-foreign-keys-that-reference-a-table/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
		<item>
		<title>Design Pattern: Object Pool</title>
		<link>http://allwrong.wordpress.com/2011/02/07/design-pattern-object-pool/</link>
		<comments>http://allwrong.wordpress.com/2011/02/07/design-pattern-object-pool/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 16:58:42 +0000</pubDate>
		<dc:creator>kramii</dc:creator>
				<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://allwrong.wordpress.com/?p=1003</guid>
		<description><![CDATA[Type Creational Patterns Name Object Pool AKA Resource Pool Motivation Performance can be an important consideration for applications. In some scenarios, object creation is a costly step. Intent Avoids cost of initializing objects by maintaining a pool of pre-initialized objects that can be re-used. Description of Benefits Can offer a performance boost where: object instantiation [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1003&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Type</h3>
<p>Creational Patterns</p>
<h3>Name</h3>
<p>Object Pool</p>
<h3>AKA</h3>
<p>Resource Pool</p>
<h3>Motivation</h3>
<p>Performance can be an important consideration for applications. In some scenarios, object creation is a costly step.</p>
<h3>Intent</h3>
<p>Avoids cost of initializing objects by maintaining a pool of pre-initialized objects that can be re-used.</p>
<h3>Description of Benefits</h3>
<p>Can offer a performance boost where:</p>
<ul>
<li>object instantiation is expensive</li>
<li>instances of the class are frequently created</li>
<li>number of instances at any one time is small</li>
</ul>
<p>Can make initialization time predictable where it would otherwise be unpredictable (e.g. when squiring resources over a network)</p>
<h3>Known Uses</h3>
<p>Instantiation of objects that represent:</p>
<ul>
<li>database connections</li>
<li>socket connections</li>
<li>threads</li>
<li>large graphic objects</li>
</ul>
<h3>Real-World Illustrations</h3>
<ul>
<li>Shoe shelf at a bowling club</li>
<li>Car pooling</li>
<li>Library</li>
</ul>
<h3>Participants</h3>
<p><strong>Reusable</strong>: An object used by <em>Client</em> until they it is no longer required.</p>
<p><strong>Client</strong>: Uses an instance of <em>Reusable</em> for a limited amount of time</p>
<p><strong>ReusablePool</strong>: Manages the collection of <em>Reusable</em> objects by:</p>
<ul>
<li>creating new instances of <em>Reusable</em></li>
<li>supplying instances of <em>Reusable</em> to <em>Client</em>s</li>
</ul>
<p>Typical methods induce:<strong></strong></p>
<ul>
<li><strong>getInstance</strong>: A static method that returns an instance of <em>ReusablePool<strong></strong></em></li>
<li><strong>aquireReusable</strong>:A method that returns an instance of <em>Reusable<strong></strong></em></li>
<li><strong>releaseReusable(Reusable)</strong>:A method that returns a <em>Reusable </em>to the pool</li>
</ul>
<h3>Basic Implementation (Collaboration)</h3>
<h4>Object Creation</h4>
<p>The <em>Client </em>is responsible for requesting the <em>Reusable </em>from the <em>ReusablePool</em>.</p>
<p>On receiving a request for an object, the <em>ReusablePool </em>will attempt to supply an suitable <em>Reusable</em>.</p>
<h4>Object Use</h4>
<p>The <em>Client </em>should be unaware that the <em>Reusable </em>can be shared with other <em>Client</em>s:  from the <em>Client</em>&#8216;s point of view, the <em>Reusable </em>can be treated in exactly the same way as an object that has been created in any other way,the only difference being that it must return it to the <em>ReusablePool </em>once it has finished using it.</p>
<h4>Object Release</h4>
<p>The <em>Client </em>is responsible for returning <em>Reusables </em>to the <em>ReusablePool </em>once it is finished with.</p>
<h3>Implementation Details</h3>
<h4>Resource Loading Strategy</h4>
<p>Several strategies are available, for example:</p>
<ul>
<li><strong>Eager</strong>: A specified number of <em>Reusable</em>s are created by the <em>ReusablePool </em>when the <em>ReusablePool </em>is instantiated.</li>
<li><strong>Lazy</strong>: <em>Reusable</em>s are not created by the <em>ReusablePool </em>until they are requested by the a <em>Client</em>. Once <em>Reusable</em>s are released, they are immediately available for other <em>Client</em>s.</li>
<li><strong>Hybrid</strong>: A specified number of <em>Reusable</em>s are created eagerly, but additional <em>Reusable</em>s are created lazily.</li>
<li><strong>Lazy-Expanding</strong>: Creates resources lazily, but doesn&#8217;t re-use them until the <em>ReusablePool </em>reaches a certain size.</li>
<li><strong>Eager-Expanding</strong>: Creates resources eagerly. Creates additional resources when available objects in the <em>ReusablePool </em>drops below a certain threshold.</li>
</ul>
<h4>Maximum Pool Size</h4>
<p>Some implementations may set a maximum number of <em>Reusable</em>s in the <em>ReusablePool</em></p>
<h4>Empty Pool</h4>
<p>Various strategies can be adopted to handle the situation where a <em>Client</em> requests an instance from the pool, but none is currently available:</p>
<p>Prevent the situation by ensuring that the <em>ReusablePool </em>will always contain enough <em>Reusable</em>s.</p>
<ul>
<li>Fail to provide <em>Reusable</em>, and inform the <em>Client </em>that none is available</li>
<li>Create a new <em>Reusable</em>, thus increasing the size of the pool</li>
<li>Block until another thread to releases an object back into the pool</li>
<li>Forcible reclaim a <em>Reusable</em> from a low-priority <em>Client</em></li>
</ul>
<h4>Synchronization</h4>
<p>In a multi-threaded environment, careful consideration must be given to synchronisation of methods on the <em>ResourcePool</em> object.</p>
<h4>Failed Release</h4>
<p>If the <em>Client </em>fails to return a <em>Reusable </em>to the pool, then it will be unavailable to other <em>Client</em>s. To avoid this, the <em>ResourcePool </em>could implement an expiry time for <em>Reusable</em>:<br />
if the <em>Reusable </em>has not actually been used for a certain length of time, it can be made available to other<em> Client</em>s.</p>
<h4>Resource Eviction</h4>
<p>In some situations, it may be undesirable to hold unused <em>Reusable</em>s in the <em>ReusablePool </em>for long periods of time. In this case, it may be desirable to evict <em>Reusable</em>s from the <em>ReusablePool </em>if they have not been requested by a <em>Client </em>for a specified length of time.</p>
<h4>Recycling Methods</h4>
<p>Some types of <em>Reusable</em>s may need to be reset to a know state before they can be allocated to another <em>Client</em>. This is the responsibility of the <em>ReusablePool</em>.</p>
<h3>Variants</h3>
<ul>
<li>Sub-pools</li>
<li>Mixed Pools</li>
</ul>
<h3>Relationship with Other Patterns</h3>
<p><em>ReusablePool </em>is often implemented as a <em>Singleton</em>.</p>
<h3>References</h3>
<ul>
<li><a href="http://www.kircher-schwanninger.de/michael/publications/Pooling.pdf">http://www.kircher-schwanninger.de/michael/publications/Pooling.pdf</a></li>
<li><a href="http://en.wikipedia.org/wiki/Object_pool">http://en.wikipedia.org/wiki/Object_pool</a></li>
<li><a href="http://www.oodesign.com/object-pool-pattern.html">http://www.oodesign.com/object-pool-pattern.html</a></li>
<li><a href="http://sourcemaking.com/design_patterns/object_pool">http://sourcemaking.com/design_patterns/object_pool</a></li>
<li><a href="http://stackoverflow.com/questions/2510975/c-object-pooling-pattern-implementation">http://stackoverflow.com/questions/2510975/c-object-pooling-pattern-implementation</a></li>
<li><a href="http://www.developer.com/tech/article.php/626171/Pattern-Summaries-Object-Pool.htm">http://www.developer.com/tech/article.php/626171/Pattern-Summaries-Object-Pool.htm</a></li>
<li><a href="http://gameprogrammingpatterns.com/object-pool.html">http://gameprogrammingpatterns.com/object-pool.html</a></li>
<li><a href="http://en.wikipedia.org/wiki/Object_pool_pattern">http://en.wikipedia.org/wiki/Object_pool_pattern</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwrong.wordpress.com/1003/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwrong.wordpress.com/1003/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwrong.wordpress.com/1003/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwrong.wordpress.com/1003/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwrong.wordpress.com/1003/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwrong.wordpress.com/1003/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwrong.wordpress.com/1003/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwrong.wordpress.com/1003/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwrong.wordpress.com&amp;blog=754372&amp;post=1003&amp;subd=allwrong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwrong.wordpress.com/2011/02/07/design-pattern-object-pool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2484f4cf7cdfd9f4f7d0b0c8cee240c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kramii</media:title>
		</media:content>
	</item>
	</channel>
</rss>
