<?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>Tim Barcz : Rant</title><link>http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx</link><description>Tags: Rant</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Ship Software With Value</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/09/29/ship-software-with-value.aspx</link><pubDate>Tue, 29 Sep 2009 18:49:24 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:51874</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>28</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=51874</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/09/29/ship-software-with-value.aspx#comments</comments><description>&lt;p&gt;The blogosphere has gone a bit crazy the last few days with posts responding to &lt;a title="The Duct Tape Programmer By Joel Spolsky" href="http://www.joelonsoftware.com/items/2009/09/23.html"&gt;Joel Spolsky’s latest article about &amp;quot;The Duct Tape Programmer&amp;quot;&lt;/a&gt;. Bloggers everywhere are tossing their two cents in and saying what parts of Joel&amp;#39;s post was good and what wasn&amp;#39;t good. Once noticeable trend is that many have jumped on the &amp;quot;just ship it&amp;quot; bandwagon.&lt;/p&gt;  &lt;p&gt;There’s a quote mentioned by Jamie Zawinski in the article:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“Yeah,” he says, “At the end of the day, ship the f---ing thing! It’s great to rewrite your code and make it cleaner and by the third time it’ll actually be pretty. But that’s not the point—you’re not here to write code; you’re here to ship products.”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I don&amp;#39;t know Jamie and I imagine the context that the comment was made in was based around some pre-existing level of candor with the person he was speaking. We really don’t know what “…ship the f---ing thing” means in the context of that conversation and what level of quality is expected in that scenario. I would agree with Joel/Jamie that shipping products is important and that often developers (myself included) run the risk of becoming too entrenched in a design or beauty and all too easily miss the point of developing software...which is to ship a product that adds value.&amp;#160; However...”shipping” is only part of the picture. As someone responsible for the value of the product my team ships, I’m keenly aware of what affects shipping early can do (both the positive and negative).&lt;/p&gt;  &lt;p&gt;I&amp;#39;m reading a lot where people say &amp;quot;just ship it&amp;quot; but I&amp;#39;ve been part of teams where shipping too soon costs more money in the long run (and sometimes not even “the long run” but a few days/weeks down the road). These pro “ship it” bloggers surely must be talking about non-critical business systems when we say &amp;quot;just ship it&amp;quot;; would you want to ride on a plane where the flight control systems were sent out with bugs? Even a measly 1% failure rate of airplane system is unacceptable and is enormously expensive both in dollars and reputation for an airline.&lt;/p&gt;  &lt;p&gt;The point is that shipping is the point but not the whole point, it&amp;#39;s only one aspect of a well delivered software product. &lt;strong&gt;Shipping software with value is the point.&lt;/strong&gt;&amp;#160; Ship too soon with bugs and the value gained by shipping is potentially lost.&amp;#160; Conversely shipping late provides no value at all.&amp;#160; Neither lobbing a piece of crap over the wall at your customers early, nor refactoring your code till it shines is the point, neither should be considered a success. There’s a sweet spot that you need to find.&amp;#160; Keep in close contact with your customer, if you pay attention they’ll let you know when you’ve crossed into either extreme.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=51874" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Testing/default.aspx">Testing</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Help: My Twitter Account Was Suspended</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/08/03/my-twitter-account-was-suspended.aspx</link><pubDate>Tue, 04 Aug 2009 04:48:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49825</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=49825</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/08/03/my-twitter-account-was-suspended.aspx#comments</comments><description>&lt;p&gt;After a really good evening at &lt;a href="http://www.crineta.org"&gt;CRineta&lt;/a&gt;, I hop online to post a final tweet of the night only to see that my account has been suspended:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_thumb.png" width="595" border="0" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Very strange indeed.&amp;nbsp; I&amp;#39;ve looked over the terms of service and to be honest I can&amp;#39;t see where I&amp;#39;ve faltered at all.&lt;/p&gt;
&lt;p&gt;*Sigh* If I&amp;#39;m silent on Twitter for the next few days you&amp;#39;ll hopefully now know why? If you by chance know someone who knows someone at Twitter who can escalate this please by all means let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49825" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category></item><item><title>The Holy Grail is NOT Automation</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/05/28/the-holy-grail-is-not-automation.aspx</link><pubDate>Fri, 29 May 2009 02:05:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47293</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>29</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=47293</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/05/28/the-holy-grail-is-not-automation.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_thumb.png" align="right" border="0" width="240" height="211" /&gt;&lt;/a&gt; Often times as developers who understand what computers can do is really limitless, we seek to automate everything.&amp;nbsp; The holy grail is being able to sit at where everything is accomplishable with a simple double-click. Often times automation, however wonderful or geek drool inspiring, is not cost effective.&lt;/p&gt;
&lt;p&gt;Once a month we have to update sales tax rates in our system.&amp;nbsp; We have a program that does the update but needs two vital pieces of information which are supplied to us a few days before the end of the month via an email.&amp;nbsp; These two pieces of information are a download file location and a password.&amp;nbsp; We enter the two pieces of information as command line args to the program and off we go.&amp;nbsp; The whole process takes about a minute.&lt;/p&gt;
&lt;p&gt;While running the update today there was a brief discussion about how we could possibly automate the whole process.&amp;nbsp; Ideas floated around like reading the email and parsing the text for the download location and the password.&amp;nbsp; In order to do this we&amp;#39;d have to write an program which:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can connect to our Exchange server or a mailbox on our system&lt;/li&gt;
&lt;li&gt;Scan the inbox for the particular message you are looking for&lt;/li&gt;
&lt;li&gt;Parse out the two pieces of information from the email&lt;/li&gt;
&lt;li&gt;Launch the original program passing in the two pieces of information we just gathered&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;#39;s say for a moment that you&amp;#39;re a good programmer. I mean &lt;a href="http://www.ayende.com/blog"&gt;ayende&lt;/a&gt; good.&amp;nbsp; How long does it take you to write this? An hour? Two?&amp;nbsp; Ten? A week (40)?&amp;nbsp; Let&amp;#39;s be real aggressive developers here with over-inflated sense of skill for a moment and say we can do this and have it production ready in an hour.&amp;nbsp; If it takes us a minute to run by hand, then &lt;b&gt;it will take us 5 years to get a return on the investment&lt;/b&gt; we put into the project.&amp;nbsp; If we&amp;#39;re more down to earth and estimate the project takes 10 hours, we &lt;b&gt;will absolutely never see a return on that time spent because your application which needs the tax information will be rewritten, trashed, or abandoned long before the 50 years it would take to start seeing a return.&amp;nbsp; &lt;/b&gt;I was glad to hear it when my fellow developers came to this conclusion as well.&amp;nbsp; Automation is great to a point when it saves time.&amp;nbsp; Any effort beyond that is hard to justify and could be seen as wasteful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47293" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Opinion/default.aspx">Opinion</category></item><item><title>Regular Expressions, Your Job Requires Them</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/05/25/regular-expressions-your-job-requires-them.aspx</link><pubDate>Tue, 26 May 2009 02:18:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47138</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>40</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=47138</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/05/25/regular-expressions-your-job-requires-them.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/RegularExpressionLearnthem_8736/image_9.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/RegularExpressionLearnthem_8736/image_thumb_3.png" width="321" align="right" border="0" height="520" /&gt;&lt;/a&gt;In preparing my talk on Regular Expressions that I&amp;#39;ll be giving this upcoming weekend at the &lt;a href="http://www.chicagocodecamp.com"&gt;Chicago Code Camp&lt;/a&gt; I decided to repost this article which I originally posted in February of last year.&amp;nbsp; Rereading the information contained within my position or thoughts on developers and regular expression have not changed.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve thought about writing this post several times over the past two years.&amp;nbsp; Having had regular expressions come up three times last week, I thought it time to address the lack of programmers out there who understand regular expressions.&amp;nbsp; The sheer amount of fear surrounding regular expressions and the work that goes into avoiding them is astonishing.&lt;/p&gt;
&lt;p&gt;Last year I used to troll around the &lt;a href="http://www.asp.net/forums/"&gt;asp.net forums&lt;/a&gt; and quite frequently I would answer the regex questions.&amp;nbsp; One &lt;a href="http://forums.asp.net/t/1125123.aspx"&gt;question was posted&lt;/a&gt; which illustrates the problem with regexes among developers.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;...and i also i need to add a validator for the password textbox where the user is required to fill atleast [sic] 6 characters&amp;quot; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I suggested a solution to the problem using a regular expression validator. Making sure there are at least 6 characters, is a simple regex (example: \w{6,}), and yet my solution was met with skepticism.&amp;nbsp; The following was said, in the event a change was requested, &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Putting a new version of a web site can take a surprising amount of time than can go into man-weeks&amp;quot;.&amp;nbsp; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Man-weeks?!?!?&amp;nbsp; To change a regular expression?!?!?&amp;nbsp; I see two problems, first the original developer who didn&amp;#39;t know that regex would easily solve their problem.&amp;nbsp; The second problem is the other developer who doesn&amp;#39;t know regex advocating his way as &amp;quot;the way&amp;quot;, in effect, spreading his ignorance.&amp;nbsp; The first developer is easily forgiven, the second is not.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s been said &lt;a href="http://www.codinghorror.com/blog/archives/000781.html"&gt;programmers can&amp;#39;t program&lt;/a&gt; when faced with a simple FizzBuzz test, &lt;a href="http://tickletux.wordpress.com/"&gt;Imran&lt;/a&gt; states:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Want to know something scary? - the majority of comp sci graduates can&amp;rsquo;t. I&amp;rsquo;ve also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#39;ll pile on.&amp;nbsp; &lt;b&gt;You want to know something scary?&amp;nbsp; The majority of professional programmers can&amp;#39;t write regular expressions, even simple ones&lt;/b&gt;.&amp;nbsp; I&amp;#39;m not the first to say this.&amp;nbsp; Last year, at the &lt;a href="http://altdotnet.org/"&gt;ALT.NET&lt;/a&gt; conference, &lt;a href="http://weblogs.asp.net/scottgu/"&gt;Scott Guthrie&lt;/a&gt; made the following statement when talking about routes in the new MVC framework:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;It&amp;#39;s pluggable, so you can use Regexes...&amp;lt;some incoherent stuff&amp;gt;...if you wanna use regexes you can.&amp;nbsp; What we found is, regexes are super powerful, but only about 10% of people actually understand &amp;#39;em.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Are regular expressions easy to understand? Well, let me ask you, was HTML easy when you started?&amp;nbsp; Were you born understanding the following HTML?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span style="font-family:Courier;font-size:x-small;"&gt;&amp;lt;fieldset class=&amp;quot;CheckRadio&amp;quot;&amp;gt;        &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id=&amp;quot;OngoingEventContainer&amp;quot;&amp;gt;         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;OngoingEvent&amp;quot; name=&amp;quot;OngoingEvent&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label for=&amp;quot;OngoingEvent&amp;quot;&amp;gt;         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is an ongoing event (no dates and times)         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/label&amp;gt;         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;         &lt;br /&gt;&amp;lt;/fieldset&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you understand the above, you didn&amp;#39;t always.&amp;nbsp; My guess is that at some point you buckled down and learned HTML because you&amp;#39;re job requires it.&amp;nbsp; Well, if you&amp;#39;re a programmer, web or windows, &lt;b&gt;you need to know regular expressions, your job requires it, it&amp;#39;s that simple.&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/RegularExpressionLearnthem_8736/image_7.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/RegularExpressionLearnthem_8736/image_thumb_2.png" width="344" align="right" border="0" height="325" /&gt;&lt;/a&gt;Regular expressions have been around so long that they&amp;#39;re deeply ingrained in many of the tools we use.&amp;nbsp; &lt;a href="http://devlicious.com/blogs/christopher_bennage"&gt;Christopher Bennage&lt;/a&gt; illustrates how regular expressions solved a recent problems in Visual Studio.&amp;nbsp; In a &lt;a href="http://devlicious.com/blogs/christopher_bennage/archive/2008/02/21/discovering-empty-try-catch-blocks.aspx"&gt;recent post&lt;/a&gt; he posts:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Then I realized that I was missing the simple solution. Ctrl+F and a regular expression!&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I don&amp;#39;t know that many people would be able to come to the conclusion that Christoper did.&amp;nbsp; It&amp;#39;s my belief that regular expressions are fundamental, yet the average developer doesn&amp;#39;t treat them as such.&amp;nbsp; They&amp;#39;re ultimately doing themselves a disservice.&lt;/p&gt;
&lt;p&gt;Regular Expressions are a tool that should be in every programmers bag.&amp;nbsp; If you don&amp;#39;t understand regular expressions and do a google search every time you need a regular expression, shame on you!&amp;nbsp; It&amp;#39;s time to bite the bullet and learn regular expressions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47138" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Regular+Expressions/default.aspx">Regular Expressions</category></item><item><title>Your IoC Container Choice is Not a Feature of Your Application</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/03/29/your-ioc-container-choice-is-not-a-feature-of-your-application.aspx</link><pubDate>Mon, 30 Mar 2009 02:51:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:45231</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>28</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=45231</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/03/29/your-ioc-container-choice-is-not-a-feature-of-your-application.aspx#comments</comments><description>&lt;p&gt;I don&amp;#39;t want to be a wet blanket, but someone&amp;#39;s got to put a stop to the IoC love fest going on out there.&amp;nbsp; An Inversion of Control (IoC) container , for those of you were aren&amp;#39;t yet familiar, allows you to retrieve instances of objects at runtime.&amp;nbsp; A relatively common solution to a common problem. In the .NET world there is no lack of choices of IoC containers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.castleproject.org/container/index.html"&gt;Castle&amp;#39;s Winsdor/MicroKernel&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.springframework.net/"&gt;Spring.NET&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/p/autofac/"&gt;AutoFac&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc468366.aspx"&gt;Unity&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://funq.codeplex.com/"&gt;Funq&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(I won&amp;#39;t go fully into IoC, but If you&amp;#39;d like more resource you can read &lt;a href="http://martinfowler.com/articles/injection.html"&gt;Martin Fowler&amp;#39;s article on the subject&lt;/a&gt; or post specific questions in the comments or contact me through.&amp;nbsp; Read on, there is value here in this post for you.)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Let me state clearly now, IoC containers are a means to an end and NOT a feature of your application.&lt;/b&gt; The goal is to have loosely coupled applications, IoC containers help get you there, but you can absolutely have a loosely coupled application without an IoC container (see the &lt;a href="http://www.dofactory.com/Patterns/Patterns.aspx"&gt;Gang of Four creational patterns&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Occasionally I&amp;#39;ll hear some comment about IoC and how great a certain container is or how an application would be so much better if another, sexier, container was used.&amp;nbsp; Here are some recent &lt;a href="http://www.twitter.com"&gt;tweets&lt;/a&gt; that illustrate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Man i love #StructureMap, always finding new things i can do, and have fun doing them &lt;/li&gt;
&lt;li&gt;really need to look at structuremap, but we&amp;#39;&amp;#39;ve invested a lot into castle with our own facilities/resolvers/etc &lt;/li&gt;
&lt;li&gt;Ninject is da bomb! &lt;/li&gt;
&lt;li&gt;Switched from Windsor MicroKernel to Ninject in 10KLOC project in &amp;lt; 1 hour by creating a little proxy. Now to complete the conversion. &lt;/li&gt;
&lt;li&gt;It is a talk on Castle Windsor so i guess Ninject will not do. &lt;/li&gt;
&lt;li&gt;Can&amp;#39;t imagine why somebody would use Ninject beside the fact that it&amp;#39;s PURE AND UTTER AWESOME. Yeah! Ninject FTW. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some of the statements above are probably innocuous, but some rub me slightly the wrong way.&amp;nbsp; Specifically the two comments above about switching from one container to another. There are probably times when the choice of one container over another makes sense, but I would bet that these scenarios are the exception and not the rule.&lt;/p&gt;
&lt;p&gt;Choosing one container over another won&amp;#39;t make your application a success, the architecture, or lack there of, will have far more of a say on your application than will your container choice. As yoda might say, &amp;quot;The container you choose does not a good app make&amp;quot;. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=45231" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Windsor/default.aspx">Windsor</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Exercise Caution When Using Floating Point Numbers</title><link>http://devlicio.us/blogs/tim_barcz/archive/2008/11/05/exercise-caution-when-using-floating-point-numbers.aspx</link><pubDate>Wed, 05 Nov 2008 20:13:11 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:42907</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>28</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=42907</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2008/11/05/exercise-caution-when-using-floating-point-numbers.aspx#comments</comments><description>&lt;p&gt;I understand floating point numbers can be somewhat imprecise but I&amp;#39;m a bit bothered today when I see the following evaluates to false:&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;float&lt;/span&gt; f = .16f;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; d = .16d;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt; Assert.That(f, Is.EqualTo(d))&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Annoyingly I wanted to see what the two values are:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; Console.WriteLine((&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)f)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; Console.WriteLine(d);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;produces the following respectively:&lt;/p&gt;

&lt;p&gt;.159999996423721&lt;/p&gt;

&lt;p&gt;.16&lt;/p&gt;

&lt;p&gt;What bothers me about this, and I&amp;#39;m hoping someone can eloquently explain this, the MSDN docs say this should be implicitly converted.&amp;#160; From the &lt;a href="http://msdn.microsoft.com/en-us/library/aa691282(VS.71).aspx"&gt;MSDN doc article on implicit numeric conversions&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;From &lt;code&gt;float&lt;/code&gt; to &lt;code&gt;double&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Float is 32-bit and double is 64-bit, so why can&amp;#39;t the float fit nicely inside the address space for the double?&lt;/p&gt;

&lt;p&gt;Hell, if you&amp;#39;re not going to respect the integrity of the number what&amp;#39;s the point of the implicit conversion?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=42907" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Help/default.aspx">Help</category></item><item><title>Testing Pre-Requisite - Care About Your Code</title><link>http://devlicio.us/blogs/tim_barcz/archive/2008/10/02/testing-pre-requisite-care-about-your-code.aspx</link><pubDate>Fri, 03 Oct 2008 02:20:10 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:42557</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>16</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=42557</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2008/10/02/testing-pre-requisite-care-about-your-code.aspx#comments</comments><description>&lt;p&gt;There&amp;#39;s a lot of posts and chatter about testing, TDD, and a number of other topics on this blog, the larger &lt;a href="http://devlicio.us"&gt;devlicio.us&lt;/a&gt; site, and the .NET community in general.&amp;#160; Before all that, it should go without saying, but it must be said; there is a pre-requisite to testing, care about your code.&lt;/p&gt;  &lt;p&gt;You have probably come across some code in your career that is less than ideal.&amp;#160; Maybe you&amp;#39;ve even submitted something to the &lt;a href="http://www.dailywtf.com"&gt;Daily WTF&lt;/a&gt;. I&amp;#39;m currently combing some old code trying pull out some main concepts.&amp;#160; As I&amp;#39;m going through the code I&amp;#39;m seeing some things that really are quite alarming.&amp;#160; I&amp;#39;m not talking about differences in what I would do in terms in architecture, implementation, or even language choice.&amp;#160; I&amp;#39;m talking about blatant code rot, code that no one has cared for.&lt;/p&gt;  &lt;p&gt;Some stats for the current file I&amp;#39;m in:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Lines in file: 1820.&amp;#160; This is the mildest offense, while I don&amp;#39;t endorse a class/file that large I can live with it. &lt;/li&gt;    &lt;li&gt;Classes defined in the file: 19.&amp;#160; I find this a &amp;quot;little&amp;quot; excessive, Even if you don&amp;#39;t subscribe to the &amp;quot;one class per file&amp;quot; rule, 19 is a bit much don&amp;#39;t you think? &lt;/li&gt;    &lt;li&gt;Example Method: 697 lines.&amp;#160; That number isn&amp;#39;t entirely accurate as 395 of the lines are commented out.&amp;#160; I understand the scenario that probably led to this, in fact I&amp;#39;ll admit to doing it.&amp;#160; You comment out some code as a fail-safe in case the new implementation doesn&amp;#39;t work.&amp;#160; The problem here is that the code does work (and I use that term loosely).&amp;#160; The developer never cleaned up after themselves and their trial code.&amp;#160; This makes absolutely no sense when you have source control in place. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Here&amp;#39;s a method I came across today:&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Overrides&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Function&lt;/span&gt; ToString() &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;String&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;If&lt;/span&gt; IsNothing(_fields) &lt;span style="color:#0000ff;"&gt;Then&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;Return&lt;/span&gt; &lt;span style="color:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;If&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; r2 &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;String&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     &lt;span style="color:#008000;"&gt;&amp;#39;make room for 1 char and 1 delimeter for each field&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; retVal &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; StringBuilder = &lt;span style="color:#0000ff;"&gt;New&lt;/span&gt; StringBuilder(&lt;span style="color:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, _fields.Length * 2) &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;For&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Each&lt;/span&gt; f &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; Field &lt;span style="color:#0000ff;"&gt;In&lt;/span&gt; _fields&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         r2 = r2 &amp;amp; f.Prefix &amp;amp;_ &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;             f.Value &amp;amp;_ &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;             f.Postfix &amp;amp;_ &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;             ConfigurationSettings.AppSettings(&lt;span style="color:#006080;"&gt;&amp;quot;ControllerFieldDelimeter&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;         retVal.Append(f.Prefix)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;             .Append(f.Value)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;             .Append(f.Postfix)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;             .Append(ConfigurationSettings.AppSettings(&lt;span style="color:#006080;"&gt;&amp;quot;ControllerFieldDelimeter&amp;quot;&lt;/span&gt;))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;Next&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;     r2 = r2 &amp;amp; &lt;span style="color:#006080;"&gt;&amp;quot;&amp;lt;EOT&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;     retVal.Append(&lt;span style="color:#006080;"&gt;&amp;quot;&amp;lt;EOT&amp;gt;&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt;     &lt;span style="color:#008000;"&gt;&amp;#39;Return retVal&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  24:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;Return&lt;/span&gt; retVal.ToString&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  25:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Function&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The first thing I noticed was the string concatenation in lines 10-13.&amp;#160; The problem is the &amp;quot;_fields&amp;quot; (the collection over which this code is iterating) can be large.&amp;#160; So concatenation isn&amp;#39;t the best choice.&amp;#160; While clearly not optimal, let&amp;#39;s let that slide for a moment.&amp;#160; The very next line, lines 14-17, there is some appending of seemingly the same data.&amp;#160; In the end r2, the concatenated value which was so expensive to generate, &lt;strong&gt;is never returned or used elsewhere&lt;/strong&gt;.&amp;#160; All of those extra, wasteful concatenation calls are spent on worthless code.&amp;#160; The developer(s) who worked with this over time simply never cleaned up after themselves or cared for the code.&lt;/p&gt;

&lt;p&gt;I&amp;#39;m amazed that code like what I&amp;#39;m looking at is found in code bases.&amp;#160; I probably shouldn&amp;#39;t be surprised but I am.&amp;#160; Today I was posting my reactions on &lt;a href="http://www.twitter.com/timbarcz"&gt;Twitter&lt;/a&gt; and a friend &lt;a href="http://rhysc.blogspot.com/"&gt;Rhys Campbell&lt;/a&gt; commented:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;quot;395 of them are commented out&amp;quot;.. delete them! do it! You know you want/need to&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think Rhys is right, I will fix the code as I see it.&amp;#160; The codebase is being phased out but that doesn&amp;#39;t mean it shouldn&amp;#39;t be cared for.&amp;#160; If I am caring for code that is going to be obsolete and replaced soon, how much more important do you suppose is it to care for your current code?&amp;#160; If any of the above sounded like your code, get with it, clean up and care for your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=42557" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category></item><item><title>Google Chrome - How Cool? Too Cool.</title><link>http://devlicio.us/blogs/tim_barcz/archive/2008/09/02/google-chrome-how-cool-too-cool.aspx</link><pubDate>Tue, 02 Sep 2008 19:59:11 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:42142</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>16</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=42142</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2008/09/02/google-chrome-how-cool-too-cool.aspx#comments</comments><description>&lt;p&gt;How cool is &lt;a href="http://www.google.com/chrome"&gt;Google Chrome&lt;/a&gt; (new browser from Google)?&amp;#160; Way cool...like &amp;quot;too cool to run on your machine cool&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="121" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_thumb.png" width="544" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Thumbs up though for their error screen, just wish I didn&amp;#39;t have to see it&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image5.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="485" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image5_5F00_thumb.png" width="569" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=42142" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category></item><item><title>The Tortoise and the Hare</title><link>http://devlicio.us/blogs/tim_barcz/archive/2008/08/11/the-tortoise-and-the-hare.aspx</link><pubDate>Mon, 11 Aug 2008 17:13:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:41790</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=41790</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2008/08/11/the-tortoise-and-the-hare.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="327" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_thumb.png" width="475" align="right" border="0" /&gt;&lt;/a&gt; We&amp;#39;re all familiar with the &lt;a href="http://www.storyarts.org/library/aesops/stories/tortoise.html"&gt;Aesop&amp;#39;s fable of the tortoise and the hare&lt;/a&gt;.&amp;#160; In the story, the hare, who is in every way is faster than the tortoise, loses a race to the tortoise.&amp;#160; The main principle of the story is that slow and steady wins the race.&lt;/p&gt;  &lt;p&gt;In my development I am shooting to be a tortoise, really I am.&amp;#160; Read on and let me explain.&lt;/p&gt;  &lt;p&gt;A few weeks ago I got some evil glares when I suggested at our .NET user group meeting that in enterprise systems that you don&amp;#39;t have time &lt;b&gt;not&lt;/b&gt; to test.&amp;#160; It&amp;#39;s a common hurdle for those new to testing to say, &amp;quot;I don&amp;#39;t have time to write tests.&amp;quot;&amp;#160; Let&amp;#39;s face it, we&amp;#39;re all busy, that excuse is tired.&amp;#160; As an agile and lean practitioner I seek out ways to improve velocity and reduce waste, not take my already busy schedule and cram in another tool for the sake of another tool.&amp;#160; While writing tests does slow me down, it brings on tortoise like speed, which I would argue is a good thing.&amp;#160; Writing unit tests is one tool that provide me the ability to keep a more consistent velocity over the course of development.&amp;#160; Without tests I can surely write things faster, the problem arises as the codebase grows and each new feature or fix takes increasingly more time. Eventually, even simple requests become arduous to implement.&amp;#160; Slowly you see your velocity come to a crawl.&lt;/p&gt;  &lt;p&gt;It&amp;#39;s an insidious cycle that I&amp;#39;ve seen before and am currently in the throes of; an application is built from scratch implementing everything the business requires. The application is enhanced and bolted on to, until you realize that you could move much faster if you could start from scratch.&amp;#160; You make pleas to your boss and explain how much productivity would improve if you could shed the hideous code base.&amp;#160; One day he gives in, you rejoice and you make the leap, start from scratch, breathing a sigh of relief at how easy implementing the features are all the while reminiscing about the old framework and how poorly it was written.&amp;#160; And now that the application is rewritten from scratch the cycle, unless you were aware of it all the while, starts again.&lt;/p&gt;  &lt;p&gt;You see, no one sets out to write crap code.&amp;#160; People do the best they can with the knowledge they have.&amp;#160; Code, following the &lt;a href="http://en.wikipedia.org/wiki/Laws_of_thermodynamics"&gt;second law of thermodynamics&lt;/a&gt;, tends towards chaos over time.&amp;#160; With unit tests in place I can refactor with more confidence and implement new features without the fear of breaking existing code.&amp;#160; If you have the ability to refactor, new code is no longer &amp;quot;bolted on&amp;quot; but rather &amp;quot;grafted in&amp;quot; becoming part of the system.&amp;#160; With a solid framework with tests in place you can much better stop the cycle of rewrites.&amp;#160; Quickly writing applications that degrade is the way of the hare.&amp;#160; Developing purposefully using unit tests causes me to be slow in the short run, but over the life of the application comes out far ahead.&amp;#160; In that way, I strive to be the tortoise.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=41790" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Testing/default.aspx">Testing</category></item></channel></rss>