<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Derik Whittaker : Opinion</title><link>http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx</link><description>Tags: Opinion</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Its all about communication, not processes….!</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2011/05/18/its-all-about-communication-not-processes.aspx</link><pubDate>Wed, 18 May 2011 07:34:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:67320</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=67320</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=67320</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2011/05/18/its-all-about-communication-not-processes.aspx#comments</comments><description>&lt;p&gt;We live in a world where thoughts and concepts are not getting smaller and simpler but rather they are getting larger and more complicated. Software teams in many cases are no longer all crammed into one room or can be fed by 2 &lt;a href="http://derivadow.com/2007/02/20/two-pizza-teams/"&gt;boxes of pizza&lt;/a&gt; (which is a large systemic issue in my opinion).&amp;nbsp; Teams are now spread out over many floors of a building (if your lucky), over many buildings in a city, or in most cases over many times zones spanning the world.&lt;/p&gt;
&lt;p&gt;As our teams become larger and the problems we are trying to solve are becoming harder one thing remains paramount to success, communication.&amp;nbsp; You can put together the greatest group of talent you can find but if the teams do not communicate effectively they are not going to be successful.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;It is funny that I am even having this thought stream because we live in a world where communicating with people has never been easier.&amp;nbsp; I can turn on my phone and call someone, text someone, IM someone, tweet them or update their wall on facebook&amp;hellip;.all from the palm of my hand.&amp;nbsp; However, teams are increasing becoming worse and worse with communication and this is going to be the downfall for projects which otherwise would have been successful.&lt;/p&gt;
&lt;p&gt;What is funny (or sad I guess) is that of all the problems we attempt to solve every day this is by far one of the simplest and easiest and requires almost NO real effort.&amp;nbsp; The problem is people are either inherently lazy and do not want to expend the energy to communicate or are guarding this information because they feel it provides them a source of power or security.&amp;nbsp; By being either lazy or secretive what they are really doing is signing their own death certificate for that project.&lt;/p&gt;
&lt;p&gt;Software teams (all teams really, but you get the idea) need to make it their #1 priority to ensure that all information, useful or not is communicated to the ENTIRE team at ALL TIMES.&amp;nbsp;&amp;nbsp; But how do they do this?&lt;/p&gt;
&lt;p&gt;By:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Communicate to the ENTIRE team at one time, do not allow the &lt;a href="http://en.wikipedia.org/wiki/Trickle-down_economics"&gt;trickle down theory&lt;/a&gt; to rule your team. &lt;/li&gt;
&lt;li&gt;Communicate EVERYTHING even if you are not sure how important it is &lt;/li&gt;
&lt;li&gt;Communicate CLEARLY and CONCISLY important decisions and dates &lt;/li&gt;
&lt;li&gt;Communicate in person when at all possible, don&amp;rsquo;t relay on email or discussion boards (this is difficult w/ distributed teams but make it work) &lt;/li&gt;
&lt;li&gt;Do not create paragraphs of information where bullet points will work better &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just a few of my thoughts.....&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=67320" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Noisy code does not equal clean code</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/02/25/noisy-code-does-not-equal-clean-code.aspx</link><pubDate>Fri, 26 Feb 2010 01:16:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55546</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=55546</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=55546</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/02/25/noisy-code-does-not-equal-clean-code.aspx#comments</comments><description>&lt;p&gt;Today I was having a conversation with one of the developers on my team (btw, this guy is going to be a rock star) and I made that statement to him that I thought we had some noisy code.&amp;#160; The context around this conversation was with our usage of &lt;a href="http://www.codeplex.com/AutoMapper"&gt;AutoMapper&lt;/a&gt; (which I love so DO NOT take this as a slight against the tool) and how by default using AutoMapper exposes too much noise and I do not like it.&lt;/p&gt;  &lt;p&gt;When I made this statement to him he was not 100% sure what I meant, so in place of having a one-off conversation with him I thought I would try to explain my thoughts to the world (hey, that is the point of blogging after all, right).&lt;/p&gt;  &lt;p&gt;When using AutoMapper to map objects from one type to another in your code you need to implement something like below:&lt;/p&gt;  &lt;pre&gt;&lt;em&gt;var someMappedDto = Mapper.Map&amp;lt;SomeModel, SomeDto&amp;gt;(someModelInstance);&lt;/em&gt;&lt;/pre&gt;

&lt;p&gt;If you look at the code there is a bit of noise here in my opinion. So what do I mean by noise? I consider anything in my code that gets in my way or does not provide me direct feedback as noise.&lt;/p&gt;

&lt;p&gt;In the line above I consider the following noise:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Mapper.Map – I do not like this because having Mapper.Map sprinkled all over my code base just means that my code has too much knowledge of the actually mapping library we use, this is noise.&amp;#160; Hey, it was for this basic concept that the &lt;a href="http://www.codeplex.com/CommonServiceLocator"&gt;Common Service Locator&lt;/a&gt; was created to help prevent&lt;/li&gt;

  &lt;li&gt;Having to provide both the source type AND the destination type – The source type should be able to be derived from the source object instance (in cases where you do not want to use the mapper for some child type of the source type).&amp;#160; I concede that you do need to provide the destination type other wise we would have no clue what you want in the end&lt;/li&gt;

  &lt;li&gt;Having to provide the source type instance in the constructor.&amp;#160; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In order to reduce the noise, and make for cleaner code I would like to see something like&lt;/p&gt;

&lt;p&gt;&lt;em&gt;var someMappedDto = someModelInstance.Map&amp;lt;SomeDto&amp;gt;();&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In my humble opinion the code above is cleaner and more concise.&amp;#160; The code above has less noise to distract me from my coding efforts.&amp;#160; In particular the code above addresses my 3 issues in regards to the noise&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Now I am abstracting my mapping library of choice (AutoMapper) away into an extension method some place, thus giving me a clean abstraction layer&lt;/li&gt;

  &lt;li&gt;I do not need to provide the source data type as it can be inferred from the instance itself (yes, only in the case where the actual type being used is the type I want)&lt;/li&gt;

  &lt;li&gt;No need to provide the type to be mapped from (well not directly)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;To me noise free code is clean, concise and easy to read.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55546" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Craftsmanship/default.aspx">Craftsmanship</category></item><item><title>A new feature request for C# I would like is fall through exceptions</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/01/20/a-new-feature-request-for-c-i-would-like-is-fall-through-exceptions.aspx</link><pubDate>Wed, 20 Jan 2010 23:58:16 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55086</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=55086</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=55086</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/01/20/a-new-feature-request-for-c-i-would-like-is-fall-through-exceptions.aspx#comments</comments><description>&lt;p&gt;Now before you write off this post as being ‘just another silly request’ hear me out.&lt;/p&gt;  &lt;p&gt;Right now in C# we can do the following &lt;/p&gt;  &lt;pre class="c#" name="code"&gt;switch( someObject )
{
	case Option1:
	case Option2:
	case Option3:
		// do something
		break;
	case Option4:
		// do something
		break:
} &lt;/pre&gt;

&lt;p&gt;Allowing fall through for a switch statement is a powerful technique.&amp;#160; It allows for multiple case statements in the same switch block to use the exact same logic, oh, and it also allows for code reduction.&lt;/p&gt;

&lt;p&gt;Given the fact that we can do this with a switch statement why can we not do this with try-catch statements?&amp;#160; &lt;/p&gt;

&lt;p&gt;As an example(s) (or a suggestion of syntax) why could we not have the following&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;try
{

} catch ( SomeException1 ) {
} catch ( SomeException2 ) {
} catch ( SomeException3 ) {
} catch ( SomeException4 se ) { 
	// do something
} catch ( SomeException5 se ) {
	// do something
}&lt;/pre&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;try
{

} catch ( SomeException1, SomeException2, SomeException3, SomeException4 se ) { 
	// do something
} catch ( SomeException5 se ) {
	// do something
}
 &lt;/pre&gt;

&lt;p&gt;I know, I know you think I have lost my mind.&amp;#160; But think about it.&amp;#160; There are times when you want to handle multiple exception types with the exact same logic.&amp;#160; However today when you do this you are forced to either create a helper method to handle the logic or repeat the logic over and over again.&amp;#160; If we had the ability to allow for fall through exceptions we could reduce duplicated code and reduce code noise.&lt;/p&gt;

&lt;p&gt;Now before you start asking questions like … let me provide some quick Q &amp;amp; A&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q)&lt;/strong&gt; If you do this you will never be able to know exactly what type of exception was thrown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A)&lt;/strong&gt; You are correct, but in this scenario do you really care about the exception type?&amp;#160; If you did I am going to guess you would break it out into individual catch block&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q)&lt;/strong&gt; When would this situation actually be practical?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A)&lt;/strong&gt; Consider this.&amp;#160; You are creating a connection to a 3rd party resource (web service, wcf, api, etc) and that connection can throw a few different exceptions.&amp;#160; In some cases if the expected exception is throw you want to log and maybe roll back a transaction or something.&amp;#160; In this case i do not want to re-throw (or just let bubble up) the exception, but at the same time I do not want to duplicate my code.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;So, let me have it.&amp;#160; Tell me how dumb this is.&lt;/p&gt;

&lt;p&gt;Tell next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55086" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Feedback/default.aspx">Feedback</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>It takes real balls to do it right</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/11/06/it-takes-real-balls-to-do-it-right.aspx</link><pubDate>Fri, 06 Nov 2009 10:57:19 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53411</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>13</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=53411</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=53411</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/11/06/it-takes-real-balls-to-do-it-right.aspx#comments</comments><description>&lt;p&gt;It does not take a genius to realize that I (and most others on this blog) are fans of &lt;a href="http://www.jetbrains.com/"&gt;JetBrains&lt;/a&gt;.&amp;#160; But what it may take a genius to realize is it takes balls to do what JetBrains does with their products.&amp;#160; &lt;/p&gt;  &lt;p&gt;You may be asking what exactly I am talking about or referring to?&amp;#160; I am taking about the fact that they are willing to throw caution to the wind and provide very early (and in many cases mostly stable) release of their products to the wild.&amp;#160; What makes this even more crazy/impressive is that they build products for software developers and we all know that software developers are the most vocal and opinionated group of people out there.&lt;/p&gt;  &lt;p&gt;The fact that JetBrains releases software early and often simply makes sense and ALL companies that release software (regardless of the type) and not be afraid of what may happen.&amp;#160; Because putting your product (in this case software) in front of customers early and often will allow you to:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Find and resolve more bugs&lt;/li&gt;    &lt;li&gt;Find and resolve any weak area in usage or workflow&lt;/li&gt;    &lt;li&gt;Find areas of the application that are still lacking&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now the trick to releasing pre-alpha, alpha or even beta software is you MUST listen users feedback and attempt to incorporate or fix any areas of concern (of course only make adjustments if they make sense for the product).&lt;/p&gt;  &lt;p&gt;So, what is the point of this post?&amp;#160; Well 2 things.&amp;#160; 1 to give kudos to JetBrains for again releasing early copies of their software and 2 tell all software companies that releasing early and often will result in a better product.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53411" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Without Context everything is suspect</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/19/without-context-everything-is-suspect.aspx</link><pubDate>Mon, 19 Oct 2009 12:02:52 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52770</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=52770</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=52770</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/19/without-context-everything-is-suspect.aspx#comments</comments><description>&lt;p&gt;Over the weekend I was having a conversation with my wife and we were not communicating on the same wave length.&amp;#160; After a few minutes of talking in circles it dawned on us that we had not established the context around the conversation and we had no real understanding of what either of us was saying.&amp;#160; This lead to remember a time a few jobs ago when ‘lack of context’ lead people to draw the wrong conclusions about a forth coming client visit.&lt;/p&gt;  &lt;p&gt;The background for this little story goes something like this.&amp;#160; We had an existing client of ours that had an internal development project underway and they wanted us to come onsite to gain a better understanding of this project as well as to see how our product could integrate/play nice with their project.&amp;#160; Prior to meeting with the client (in person or via a phone conversation) we were presented with a power point presentation which laid out the ideas and intent of this project.&amp;#160; Now keep in mind that this power point was not created specify for our viewing, but it was very, very relevant in respect to the projects goals and aspirations.&lt;/p&gt;  &lt;p&gt;As this was the first interaction (from a product development standpoint, not a sales standpoint) with this given client our team had no background or history to draw from when reviewing the slide deck.&amp;#160; As we were reviewing the deck the entire team stopped at the page that was titled ‘Rules of the Game’ and had a few bullet points which said things like ‘Don’t ask dumb questions’ and ‘Don’t make this harder than it has to be’.&amp;#160; Immediately upon reviewing this deck we all go the impression that this meeting was going to be rough and that the client was going to be a little bit on the difficult site.&lt;/p&gt;  &lt;p&gt;Fast forward a few weeks till when we were able to get onsite with the client and have a conversation with them.&amp;#160; During the initial stages of the meeting the client was doing a white board session (which I love when a client does this) about their goals and what they had in mind.&amp;#160; During this session the CIO started to go over the ‘Rules of the Game’ with the group.&amp;#160; However, this time because we had more context to go on our perception and understanding of the rules changed 100% percent.&amp;#160; The context of the conversation was not pointed towards us, the product team.&amp;#160; But rather about how he did not want the application to get in the way of the user by 1) asking dumb questions or 2) making their life harder than it needed to be. &lt;/p&gt;  &lt;p&gt;About 30 seconds after our client was finished with his whiteboard session the team members all kind of looked at each other and all came to the realization that we had misinterpreted the the message based solely on the fact there was not context in the power point deck.&amp;#160; This realization was great, because now we fully understood the client as well as their intent.&amp;#160; It also made us feel a little better because we had gone into the meeting expecting there to be a bit of hostility and in fact the exact opposite was the case.&lt;/p&gt;  &lt;p&gt;The moral of the story is this.&amp;#160; Context is a powerful part of any message.&amp;#160; If you do not clearly communicate the context in a clear and concise manor you are leaving your messages up for interpretation and this can lead to bad things.&amp;#160; The same holds true not only for emails, but also for your code. &lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52770" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Craftsmanship/default.aspx">Craftsmanship</category></item><item><title>Testing only the code of value</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/07/testing-only-the-code-of-value.aspx</link><pubDate>Wed, 07 Oct 2009 11:48:25 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52340</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>13</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=52340</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=52340</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/07/testing-only-the-code-of-value.aspx#comments</comments><description>&lt;p&gt;I am 99% sure I have had a post like this in the past, but my google-foo was weak today and I could not find it.&amp;#160; Do not let anyone blow smoke up your back side, testing is expensive, testing takes time but most importantly testing &lt;em&gt;can&lt;/em&gt; help improve the quality of your code.&lt;/p&gt;  &lt;p&gt;If you are going to spend the time and money to create automated, rerun-able unit tests make sure you spend your time/money wisely.&amp;#160; Make sure you test the code that matters, test the code which is complicated (keep in mind a LOC count does NOT equal complexity).&lt;/p&gt;  &lt;p&gt;Today when scanning some code in another part of our project I came across this tests:&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;public void AdminSetIDTest()
{
	var target = new CreateTaskActivity();
	int expected = 50;
	int actual;
	target.AdminSetID = expected;
	actual = target.AdminSetID;
	Assert.AreEqual(expected, actual);
}&lt;/pre&gt;

&lt;p&gt;When I looked at this tests 2 bells immediately went off in my mind&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The name of this tests SUCKS BALLS and does not clearly convey the intent of the test&lt;/li&gt;

  &lt;li&gt;This is testing that a property getter works (no, there is NO logic behind the getter/setter)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;If you disregard #1 from above for now (but remember clear/concise names do matter) and focus on #2 this tests adds no value to the test suite.&amp;#160; All this test is doing is ensuring that the .Net framework does its job.&amp;#160; This test is a total waste of time and energy and can actually cost you more time/money in the long run because you may have to change the useless test over time as you refactor.&lt;/p&gt;

&lt;p&gt;The key take away from this is simple.&amp;#160; You always have limited time and money when trying to get a product out the door.&amp;#160; Unit testing IMO can always help you to create a better product, but make sure you use your time and money in a way in which will allow you to maximize your ROI.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52340" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/TDD/default.aspx">TDD</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>The Sky is falling, the Sky is falling…. Or is it?</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/09/30/the-sky-is-falling-the-sky-is-falling-or-is-it.aspx</link><pubDate>Wed, 30 Sep 2009 14:25:49 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:51911</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=51911</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=51911</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/09/30/the-sky-is-falling-the-sky-is-falling-or-is-it.aspx#comments</comments><description>&lt;p&gt;I assume everyone is familiar with the children&amp;#39;s book &lt;a href="http://www.amazon.com/Chicken-Little-Steven-Kellogg/dp/0688070450"&gt;Chicken Little&lt;/a&gt; where the chicken little had an acorn fall on her head and she just assume the entire sky was falling so she ran to the king to tell him such.&amp;#160; Well, sadly too many times people in our industry do the same thing.&lt;/p&gt;  &lt;p&gt;Today I received an email from one of the product owners in my product group stating ‘the entire build &amp;amp; deploy process is broken and is going to cause our project (which is slated to go live in late 2010) to miss its deadline’. WOW, what a way to start off my day (oh yea, he CC’ed up the entire food chain).&amp;#160; &lt;/p&gt;  &lt;p&gt;Now since the build server has been mostly stable for months and I had not head too much from this team in terms of the build/deploy process I was a bit taken back about this.&amp;#160; At first I was kinda worried we may have an issue.&amp;#160; However, calmer heads prevailed about 10 seconds into my thought process and I realized this may be an email with no or little merit.&amp;#160; I decided that before I spent any time looking into the issue I needed more information.&amp;#160; I needed to know exactly what was failing, when it started, why I had not heard about this before, etc, etc.&amp;#160; So in order to possible head off anyone the food chain from also reacting as the sky was falling, I politely asked this PO to clearly state each of the problems they are experiencing and when they started to experience them and only then could we take a look at the email and take it serious.&lt;/p&gt;  &lt;p&gt;The point of this little story (apart from allowing me to vent) is to state the obvious.&amp;#160; If you find yourself in a situation where something is wrong, or you need someone else’s help in resolving an issue please, please, please do your best to understand the issue, understand the scope of the issue and do your best to clearly state what you have done to resolve the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=51911" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Your unit test may smell if…….!</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/09/09/your-unit-test-may-smell-if.aspx</link><pubDate>Wed, 09 Sep 2009 17:28:30 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:51179</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=51179</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=51179</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/09/09/your-unit-test-may-smell-if.aspx#comments</comments><description>&lt;p&gt;If you find yourself using reflection in your unit test to push &amp;#39;stub’ data into it your test just may smell.&amp;#160; Now there are times (especially when dealing with legacy code) that you need use reflection to crack open a class to push/pull values but I would strongly suggest you consider the solutions I am going to suggest.&lt;/p&gt;  &lt;p&gt;Utilizing the wrap method (see &lt;a href="http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052"&gt;Working with Legacy Code&lt;/a&gt;) to accomplish your goal.&amp;#160; &lt;/p&gt;  &lt;p&gt;Lets assume you have the following class which you want to test:&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;  public class SomeClass 
  {
    private DateTime _lastVerified;
    private DateTime _lastActivated;
   }&lt;/pre&gt;

&lt;p&gt;Now one way to push data into these fields would be to do the following:&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;    [Test]
    public void IsTimeToActivateTrueLastActivatedTheDayBeforeCurrentTimeAfterActivationTimeTest()
    {
      SomeClass accessor = new SomeClass 

      Type type = SomeClass 

      FieldInfo field2 = type.GetField(&amp;quot;_lastActivated&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);
      field2.SetValue(accessor, new DateTime(2008, 2, 29, 10, 5, 0));

      FieldInfo field3 = type.GetField(&amp;quot;_lastVerified&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);
      field3.SetValue(accessor, new DateTime(2008, 3, 1, 10, 0, 0));
    
      DateTime currentDateTime = new DateTime(2008, 3, 1, 10, 10, 0);

      MethodInfo method = type.GetMethod(&amp;quot;SomeMethod&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);
      object result = method.Invoke(accessor, new object[1] { currentDateTime });

      bool isTime = (bool)result;

      Assert.AreEqual(true, isTime);
      Assert.AreEqual(currentDateTime, field3.GetValue(accessor));
    }&lt;/pre&gt;

&lt;p&gt;Now this works, but if you do this over and over again you will kill yourself with reflection code.&lt;/p&gt;

&lt;p&gt;Option 1) Create a subclass of your class and hide the reflection inside your subclass&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;public class MySubclassOfSomeClass : SomeClass
  {
    public void SetLastActivatedTime( DateTime value )
    {
    	// set the value via reflection here
    {
	
    public void SetLastVerifiedTime( DateTime value )
    {
    	// set the value via reflection here
    {
   }&lt;/pre&gt;

&lt;p&gt;The code above will still use reflection to set the value, but it will hide the usage of reflection from your unit test and will present a less noisy test to future developers&lt;/p&gt;

&lt;p&gt;Option 2) Change the scope of the fields and subclass and extend&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;  public class SomeClass 
  {
    protected DateTime _lastVerified;
    protected DateTime _lastActivated;
   }

public class MySubclassOfSomeClass : SomeClass
  {
    public void SetLastActivatedTime( DateTime value )
    {
    	_lastActivated = value;
    {
	
    public void SetLastVerifiedTime( DateTime value )
    {
    	_lastVerified = value;
    {
   &lt;/pre&gt;

&lt;p&gt;If you change the scope of the fields to protected you could subclass the original class and do the same as option 1, but because you have access to the fields via inheritance there is no need to use reflection.&lt;/p&gt;

&lt;p&gt;So, remember that tests are code to and if you feel pain writing test you may be doing it wrong.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=51179" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/TDD/default.aspx">TDD</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Quantity is NOT a measure of Quality</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/08/21/quantity-is-not-a-measure-of-quality.aspx</link><pubDate>Fri, 21 Aug 2009 14:08:15 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:50163</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=50163</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=50163</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/08/21/quantity-is-not-a-measure-of-quality.aspx#comments</comments><description>&lt;p&gt;Today I was asked what I thought about asking each of our feature teams to report the total number of new unit tests created during their iteration.&amp;#160; My knee-jerk reaction was to ask the person WTF were they thinking.&amp;#160; However, my better sense (yea, I have a little common sense) kicked in.&lt;/p&gt;  &lt;p&gt;Before I started to explain my point of view, I asked the person what the intent of this requirement was?&amp;#160; Their reasons were below:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;With this in place it will keep the developers inline in terms of knowing that creating tests is important&lt;/li&gt;    &lt;li&gt;More tests == more coverage which SHOULD increase code quality&lt;/li&gt;    &lt;li&gt;Simple measurement tool to track work items&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Once all the points were stated, only then did I state my view.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Reason: With this in place it will keep the developers inline in terms of knowing that creating tests is important&lt;/strong&gt;      &lt;br /&gt;I am ok with this being a goal as it is important for each developer to clearly understand what is expected of them when creating code.&amp;#160; However, I would rather show them why creating unit tests should lead to better code with less bugs rather than force them to write tests or else.&amp;#160; &lt;br /&gt;      &lt;br /&gt;We as a profession need to start taking the stance that we must &lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/11/04/removing-words-like-convince-convert-and-persuade-from-our-vocabulary.aspx"&gt;convince or persuade&lt;/a&gt; developers, but rather show them why one way may be preferred or better.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Reason: More tests == more coverage which SHOULD increase code quality&lt;/strong&gt;      &lt;br /&gt;In general principle I agree with this statement, however unit test count is NOT a good measure.&amp;#160; Here is why:      &lt;br /&gt;      &lt;br /&gt;I could spend 2-3 hours creating a single unit test that proves out a extremely critical path in code which adds great value or I can spend 2-3 hours created 20+ test that add little to no value.&amp;#160; It is because of this single fact that count of tests (like lines of code count) can be a very, very useless measure.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Reason: Simple measurement tool to track work items&lt;/strong&gt;      &lt;br /&gt;Well, I guess there is only one thing I could say for this one….When should I turn in my TPS reports       &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Anyway, If you are reading this and can take anything away, it should be this. Measurements are good, but make sure you are measuring the right metric.&amp;#160; In terms of measuring code, lines of code and count of tests may not be the best measurement.&amp;#160; &lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=50163" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Wow, the hatred for ‘var’ lives on</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/08/14/wow-the-hatred-for-var-lives-on.aspx</link><pubDate>Fri, 14 Aug 2009 19:41:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:50069</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=50069</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=50069</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/08/14/wow-the-hatred-for-var-lives-on.aspx#comments</comments><description>&lt;p&gt;Here we are almost 2 full years since the var keyword was released to the wild, and only a few short months (I hope) till the next release of the .net framework and still the hatred for the var keyword lives on.&lt;/p&gt;
&lt;p&gt;The other day I woke up to find the following rant waiting for me in an IM window:    &lt;br /&gt;[21:46] VarHatingDude: God I hate the var keyword     &lt;br /&gt;[21:46] VarHatingDude: worst thing ever invented     &lt;br /&gt;[21:47] VarHatingDude: deferred type is bullshit     &lt;br /&gt;[21:47] VarHatingDude: I want to see my types defined in my class     &lt;br /&gt;[21:47] VarHatingDude: before I mouse over them     &lt;br /&gt;[21:47] VarHatingDude: I will never use that piece of shit     &lt;br /&gt;[21:47] VarHatingDude: it&amp;#39;s called lazy programming&lt;/p&gt;
&lt;p&gt;At first i just kinda dismissed this rant and moved on.&amp;nbsp; However, something about this made me think I should ponder the rant a bit more.&amp;nbsp; After giving this a bit more thought here is what I have to say to the &amp;lsquo;var hatters&amp;rsquo; out there.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;RE: Differed Type: Is not a &amp;lsquo;differed type&amp;rsquo;, but instead it is an inferred typed variable.&amp;nbsp; What does this mean?&amp;nbsp; (&lt;a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx"&gt;from MSDN&lt;/a&gt;) Local variables can be given an inferred &amp;quot;type&amp;quot; of var instead of an explicit type. The var keyword instructs the compiler to infer the type of the variable from the expression on the right side of the initialization statement. The inferred type may be a built-in type, an anonymous type, a user-defined type, or a type defined in the .NET Framework class library.      &lt;br /&gt;      &lt;br /&gt;What does this mean?&amp;nbsp; Basically I can use var on the left hand side and the compiler will infer its type based on the INITIAL context it was used.&amp;nbsp; Once its type has been inferred by the compiler it cannot be swapped or changed.      &lt;/li&gt;
&lt;li&gt;RE: Lazy Programming: I have to say I 100% disagree with this.&amp;nbsp; To me using var is more about clean reading and more concise code.&amp;nbsp; Take the following code     &lt;br /&gt;Person person = new Person();       &lt;br /&gt;The code above tells me in 3 places i am dealing with a person and this is a bit of overkill.&amp;nbsp; If I use var as below I am not repeating myself over and over again:      &lt;br /&gt;var person = new Person();      &lt;/li&gt;
&lt;li&gt;Var allows for cleaner refactoring when you follow interface driven development.&amp;nbsp; Many times I have changed the interface that I return (not simply doing a rename) from an object/method and as long as the new interface contains the same signature there is no need to recompile or recode my changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you still hate var after 2+ years of it being out check out the follow blogs for other reasons to like/use it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.infoq.com/news/2008/05/CSharp-var"&gt;C# Debate: When Should You Use var?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blah.winsmarts.com/2006/05/17/demystifying-c-30--part-1-implicitly-typed-local-variables-var.aspx"&gt;Demystifying C# 3.0 - Part 1: Implicitly Typed Local Variables &amp;quot;var&amp;quot;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blaenkdenum.com/usage-of-the-var-keyword-in-csharp/"&gt;Usage of the Var keyword&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/06/25/the-var-war-is-brewing.aspx"&gt;The var war is brewing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://subjunctive.wordpress.com/2007/12/13/clarity-with-var-in-c-3/"&gt;Clarity w/ Var in C#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But like everything else in programming it all boils down to personal taste at the end of the day.&amp;nbsp; However, if you do not like something that is cool, do your own thing your own way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=50069" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Tests are not ‘Tasks’ you put on a backlog…</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/27/tests-are-not-tasks-you-put-on-a-backlog.aspx</link><pubDate>Tue, 28 Jul 2009 00:57:50 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49581</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=49581</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=49581</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/27/tests-are-not-tasks-you-put-on-a-backlog.aspx#comments</comments><description>&lt;p&gt;Today I had a conversation with our ‘scrum of scrum’ masters (we have 7 different scrum teams on our product team of 60+) and he asked me why someone would provide ‘developer tests’ as a task for the backlog?&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Before I go any further, this is NOT a bait type of email, simply my opinion.&amp;#160; If you do not buy into the testing (either TDD or test after) then you can disregard this post.&amp;#160; But if you do buy into the testing concepts keep reading.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In order to gain a better understanding of the context I asked my SoS master for more background on this project and what they were doing.&amp;#160; After a brief conversation I became very clear to me that this developer did not think of testing as part of his requirement of building out a feature, but rather as a stand alone deliverable that he needed to deliver at the end of the sprint.&lt;/p&gt;  &lt;p&gt;I explained that all developers on our team need to stop thinking in this way and to start looking at tests as ‘first class citizens’ when creating code.&amp;#160; I believe the exact statement I gave him was:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;When developers are creating a feature, the unit tests which prove the feature as being valid is just as critical as the code which implements the feature.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Quite simply, IN MY OPINION if you buy into the testing concepts stop thinking about tests as a second class citizen and start thinking about them as part of your deliverable.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49581" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Craftsmanship/default.aspx">Craftsmanship</category></item><item><title>Throw away and rebuild or refactor from within</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/13/throw-away-and-rebuild-or-refactor-from-within.aspx</link><pubDate>Mon, 13 Jul 2009 19:39:19 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49367</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=49367</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=49367</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/13/throw-away-and-rebuild-or-refactor-from-within.aspx#comments</comments><description>&lt;p&gt;The other day on Twitter there was a stream whether it is better to completely scrap an applications code base and start over, or refactor from within.&amp;#160; Now I do want to state right now:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The information here is based on my experiences and is simply my opinion.&amp;#160; I know this is almost on par with the average biblical debate so lets just agree to disagree now.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Anyway, now that I have put on the standard disclaimer lets continue on with the post.&amp;#160; As I stated there was a debate on which was better, rewrite or refactor…..&lt;/p&gt;  &lt;p&gt;Once upon a time I thought that without a doubt that rewriting that crap filled, unmanageable and unextendable code was the ONLY way to succeed.&amp;#160; However, during my career I have come to the conclusion that rewriting was actually the wrong decision and refactor from within is the right one.&amp;#160; Here are some of my thoughts as to why&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Re-Writing     &lt;br /&gt;Pros:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You get to scrap that old code that smells.&lt;/li&gt;    &lt;li&gt;You get to build a better, more maintainable architecture going forward.&lt;/li&gt;    &lt;li&gt;You get to use the latest technologies and this is always the best thing.&lt;/li&gt;    &lt;li&gt;We know the business better now, this will allow us to create a better, more flexible application&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Is the business going to actually stop innovating or changing long enough to let you completly rewrite the application?&amp;#160; NO&lt;/li&gt;    &lt;li&gt;If they are not going to stop moving forward this means there is going to be a maintance team doing this type of work.&amp;#160; This means you are coding against a moving set of requirements that will change daily… FAIL&lt;/li&gt;    &lt;li&gt;What makes you think that you can write it better the second time around?&amp;#160; If you wrote unmaintable crap the first time why do you think you are better now (ok, assuming you did write it the first time).&amp;#160; &lt;/li&gt;    &lt;li&gt;More than likely you are simply going to pile on the latest tech because you can.&amp;#160; Because you are an ego freak and the only way to write good code is to use new tech&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Refactor from Within     &lt;br /&gt;Pros:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You have the ability to continue delivering new versions of the application with new features.&lt;/li&gt;    &lt;li&gt;You actually increase your knowledge of what ‘crappy’ code looks like and how to fix it.&lt;/li&gt;    &lt;li&gt;You can learn how to refactor your legacy code with minimal risk and learn how to do it a way that allows you to deliver new code&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This is NOT easy&lt;/li&gt;    &lt;li&gt;This is NOT slow&lt;/li&gt;    &lt;li&gt;There is always the thought that you will never actually be complete and that the refactor effort will be dropped at some point in the future.&amp;#160; If this is true, rest assured that your application will be better off anyway.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Ok, there you have it, my list of pros/cons for each (this is not an all encompassing list, just some of my random thoughts).&amp;#160; In my opinion the refactor is a better, safer choice.&amp;#160; But this is not as sexy and takes a ton more effort and patience.&amp;#160; However, I believe in the long run you will be better off.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49367" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>You know you buy into Testing and Testabilty when you wrap a singleton simply to create an abstraction…</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/05/15/you-know-you-buy-into-testing-and-testabilty-when-you-wrap-a-singleton-simply-to-create-an-abstraction.aspx</link><pubDate>Fri, 15 May 2009 22:27:58 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:46845</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=46845</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=46845</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/05/15/you-know-you-buy-into-testing-and-testabilty-when-you-wrap-a-singleton-simply-to-create-an-abstraction.aspx#comments</comments><description>&lt;p&gt;I am a little bored so I thought I would write a nice fluent interface around the Performance Counter crap that is part of .net.&amp;#160; I know, I know the world does not really need another Fluent Interface around something, but I am bored and this is keeping be busy while waiting for my flight.&lt;/p&gt;  &lt;p&gt;Anyway, about 30 min into the coding session (going a bit slow as I am trying to use CodeRush/Refactor Pro in place of ReSharper) I needed to use the PerformanceCounterCategory class.&amp;#160; The problem is this.&amp;#160; Since this is a singleton isolating this during my tests is too painful, and because it is a singleton I cannot create an inheritance hierarchy to allow me to isolate it better.&amp;#160; So, what did I do?&amp;#160; &lt;/p&gt;  &lt;p&gt;I created a wrapper around the singleton.&amp;#160; By having this wrapper (and accompanying interface) I will be able to better isolate my tests and not actually create a shit load of categories and counters all the time.&lt;/p&gt;  &lt;p&gt;Wrap Strategy Refactoring === FOR THE WIN&lt;/p&gt;  &lt;p&gt;Singletons == FOR THE LOSS&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=46845" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/TDD/default.aspx">TDD</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Refactoring Project Structure is just as important as Refactoring Code</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/04/15/refactoring-project-structure-is-just-as-important-as-refactoring-code.aspx</link><pubDate>Wed, 15 Apr 2009 19:27:54 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:46057</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=46057</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=46057</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/04/15/refactoring-project-structure-is-just-as-important-as-refactoring-code.aspx#comments</comments><description>&lt;p&gt;We talk about how important it is to keep your code in working order, but no one ever really talks about keeping the container for your code in working order --- Your Project Solutions.&lt;/p&gt;  &lt;p&gt;Per Wikipedia Refactoring code can be defined as:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Means improving it without changing its overall results, and is sometimes informally referred to as &amp;quot;cleaning it up&amp;quot;. Refactoring neither fixes bug nor adds new functionality, though it might precede either activity&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Lets take a look at some of the reasons why we refactor our code base (this list is NOT the be-all-end-all list)&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Keep our code soft and flexible &lt;/li&gt;    &lt;li&gt;We encounter new needs for our code and we refactor to allow for these changes &lt;/li&gt;    &lt;li&gt;Improve the design of the code &lt;/li&gt;    &lt;li&gt;Make the code design easier to understand &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you look at the above list you can see that you can apply many of these to the structure of your application.&amp;#160; Let me provide a few examples&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strike&gt;Keep our code soft and flexible&lt;/strike&gt; Keep your source tree/project tree flexible       &lt;br /&gt;We all have been on projects that just kept growing and growing.&amp;#160; If you continue to let this happen eventually you will find yourself in a world of hurt.&amp;#160; Take the time, prune your project solutions.&amp;#160; Maybe it make sense to create multiple solutions… Either way keep it under control.       &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;We encounter new needs for our &lt;strike&gt;code&lt;/strike&gt; Structure and we refactor to allow for these changes       &lt;br /&gt;When our code starts to smell we refactor it. We may refactor the layout, the structure or how the pieces work.&amp;#160; We should do the same for our code structure.&amp;#160; If a given assembly is doing too much then break it down.&amp;#160; If a given namespace has too much responsibility, create a new one.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Improve the design of the &lt;strike&gt;code&lt;/strike&gt; source tree       &lt;br /&gt;See above :)      &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Make the &lt;strike&gt;code design &lt;/strike&gt;source layout easier to understand       &lt;br /&gt;Making your project easier to navigate and find stuff is very, very important.&amp;#160; We refactor code so the next guy can determine which way is up.&amp;#160; We should refactor our project structure so the next guy knows how to find/add what is needed.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;So the next time you think that refactoring only applies to your source code, stop and think again.&amp;#160; The principles of refactoring (making changes to the content without changing the intent) can apply to many other aspects of our jobs.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=46057" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Ivory tower policies or mandates are counter productive</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2009/03/19/ivory-tower-policies-or-mandates-are-counter-productive.aspx</link><pubDate>Thu, 19 Mar 2009 11:31:03 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:45043</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>13</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=45043</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=45043</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2009/03/19/ivory-tower-policies-or-mandates-are-counter-productive.aspx#comments</comments><description>&lt;p&gt;I am sure that most of you have heard the term ‘Ivory Tower Architect’ and most of have a mental image of what this means.&amp;#160; To me, when I hear the team I think of a person or team of washed up, has been developers who are no longer capable of creating quality code so now they have been relegated to ‘mandating process and standards’.&amp;#160; &lt;/p&gt;  &lt;p&gt;What got me thinking about this was a comment to one of my recent posts about doing &lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/03/13/if-you-cannot-do-a-source-pull-and-compile-you-are-doing-it-wrong.aspx"&gt;pull and compiles on your source code&lt;/a&gt;.&amp;#160; In this post I speak about how your team/organization needs to be able to simply pull and compile all and any source in about 5 minutes.&amp;#160; I also mention that the source should not depend on any 3rd party installs to simply compile, but if it MUST (and I know, I know there is always an exception to my rule) then you better have that installer inside your source tree along with a readme to explain to a new developer exactly WHAT must take place prior to compiling the code.&lt;/p&gt;  &lt;p&gt;The comment that got me thinking started off great.&amp;#160; The person made the statement that you should simply have to hit F5 to compile and run, and I guess in concept I agree with that, but I still think that you should be able to do a command line build without the IDE.&amp;#160; But later in the comment the he goes on to say&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Any &amp;#39;special&amp;#39; libraries should be a part of the corporate image for a developers machine - a *real* shop isn&amp;#39;t going to have umpteen different libraries anyway - they&amp;#39;ll have a stack, and that stack will be the standard for every project.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now, the first part of that statement about the corporate image I can agree with, however the second part is what got me all fired up.&amp;#160; That part of the sentence just reeks of ivory tower architecture or mandates and I am always fearful of these types of mandates.&amp;#160; Why am I fearful of these… well glad you asked.&amp;#160; Mainly I don like these types of mandates for two reasons:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Lack of context      &lt;br /&gt;&lt;/strong&gt;How could a group of people, or even a department within an development organization know the needs of each &lt;strong&gt;INDIVIDUAL&lt;/strong&gt; team?&amp;#160; I have seen and heard about the situations where a set of standards or frameworks (mostly home grown of course) were pushed down from above and were told, ‘these are the tools/frameworks that every team must use’.&amp;#160; Can someone tell me how a member that is NOT on my team can possible know what tools/frameworks we need?&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Stifles innovation     &lt;br /&gt;&lt;/strong&gt;We are software professionals, we are paid a ton of money to create business value.&amp;#160; How can we do this in a innovate way if we are told which tools/frameworks we can use.&amp;#160; Not to mention, the pace of change in our industry is so fast and so often that if a team is told which tools they can use the chances are they will be years behind the 8-ball.&amp;#160; &lt;/p&gt;  &lt;p&gt;I understand that teams, even organizations what to have standards in place in terms of tools and practices.&amp;#160; However, ever team has a unique need and each team needs to have the ability to make its own decision and forge its own path.&amp;#160; Now do not get me wrong, when working on a big team there does need to be a standard set of tools (which logger to use, which testing framework, which IoC container, etc, etc) that will be used.&amp;#160; However, this is the standard for THIS TEAM ONLY, and the standard was decided on by THIS TEAM.&amp;#160; The distinction here may be subtle to some, but is great to me.&amp;#160; By allowing each team to make their own decisions, they are better able to asses their needs and create better software.&lt;/p&gt;  &lt;p&gt;Let software developers do what they do.. Create Business Value through solving business problems.&amp;#160; Only way this can happen is if each team has the flexibility to make its own decisions.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=45043" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Rant/default.aspx">Rant</category></item></channel></rss>