<?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 : Musings</title><link>http://devlicio.us/blogs/tim_barcz/archive/tags/Musings/default.aspx</link><description>Tags: Musings</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Poor Design Is Not a Bug</title><link>http://devlicio.us/blogs/tim_barcz/archive/2010/11/25/poor-design-is-not-a-bug.aspx</link><pubDate>Fri, 26 Nov 2010 03:37:18 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:63610</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>189</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=63610</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2010/11/25/poor-design-is-not-a-bug.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.ayende.com/blog"&gt;Ayende&lt;/a&gt; recently posted a an article titled &lt;a title="Ayende&amp;#39;s post &amp;quot;Where is the Bug?" href="http://ayende.com/Blog/archive/2010/11/17/where-is-the-bug-yet-again.aspx"&gt;“Where is the bug”&lt;/a&gt;.&amp;#160; While reading the comments, I was disappointed by some of the answers to Ayende’s request to find the bug. Here are two of the comments that stood out to me:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;“You could argue the biggest bug is the use of a switch statement as it violates OCP.“ &lt;/li&gt;    &lt;li&gt;“The use of a switch statement is a bug in itself.“ &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;What bothers me so greatly is people’s inability to separate design discussion with bugs. A bug is defined on Wikipedia as:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;A &lt;b&gt;software bug&lt;/b&gt; is the common term used to describe an error, flaw, mistake, &lt;a href="http://en.wikipedia.org/wiki/Failure"&gt;failure&lt;/a&gt;, or &lt;a href="http://en.wikipedia.org/wiki/Fault_%28technology%29"&gt;fault&lt;/a&gt; in a computer program or &lt;a href="http://en.wikipedia.org/wiki/Software_system"&gt;system&lt;/a&gt; that produces an incorrect or unexpected result, or causes it to behave in unintended ways&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The two comments above don’t attempt to solve the bug and instead take an “ivory tower approach” to the problem (more befuddling is that removing the switch in favor of something else would leave the bug in place). This bugs me because we (as an industry) continue to care very little about the output and meeting of customer/business needs and more about code structure and semantics than actually working code.&lt;/p&gt;  &lt;p&gt;Let me state for the record, it is &lt;em&gt;perfectly acceptable&lt;/em&gt; to talk about code structure and design but please let’s not confuse a bug – an actual error or flaw in code – with poor design.&lt;/p&gt;  &lt;p&gt;(I think it’d be humorous for Ayende to post some perfectly fine code and ask “Where’s the bug” and watch people trip over themselves trying to find something wrong)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=63610" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Principles/default.aspx">Principles</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Common+Sense/default.aspx">Common Sense</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Musings/default.aspx">Musings</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Commentary/default.aspx">Commentary</category></item><item><title>Are You Playing Checker or Chess? - YAGNI Revisited</title><link>http://devlicio.us/blogs/tim_barcz/archive/2010/03/15/are-you-playing-checker-or-chess-yagni-revisited.aspx</link><pubDate>Mon, 15 Mar 2010 05:08:37 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55956</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>18</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=55956</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2010/03/15/are-you-playing-checker-or-chess-yagni-revisited.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_7E5F94FB.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="image" border="0" alt="image" align="right" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_thumb_5F00_69954E8E.png" width="377" height="252" /&gt;&lt;/a&gt; This past Saturday I had an early morning coffee with a friend. He’s an entrepreneurial type – a big thinker who moves at a fast pace and is always thinking ahead.&amp;#160; One question he asked of me, “Are you playing checkers or chess?”.&lt;/p&gt;  &lt;p&gt;The question was asked around business and career but I could not help but think of the implications to software.&lt;/p&gt;  &lt;p&gt;In the agile software world we often use the mantra…”do the simplest thing that works”.&amp;#160; I have found that I cringe at the usage of that statement at certain points (when honest - even at my own usage at times upon later reflection).&amp;#160; Really, if we step back and honestly evaluate ourselves, how often do we really implement the simplest thing that works. My opinion is that it’s often used as an excuse to get get out of work - a “wild card” of sorts that’s pulled out when convenient.&lt;/p&gt;  &lt;p&gt;With “the simplest thing that works”, developers associate the term YAGNI – You Ain’t Gonna Need It.&amp;#160; While very often true – you really don’t need that feature (studies have demonstrated and confirmed) – I see times where people confuse YAGNI and the agile principle of “the simplest thing that works”. What’s the difference? &lt;/p&gt;  &lt;p&gt;Chess versus checkers my friend. Checkers is a pretty simple game with few rules and even fewer game pieces.&amp;#160; Chess however has several game pieces, each of which has their own movements and rules associated with them.&amp;#160; The types of discussions and strategies that exist around chess do not exist around checkers.&amp;#160; Put simply, chess is much more complex than checkers.&amp;#160; Checkers is really treated on a move-by-move basis whereas chess is far more strategic, where moves are setup far in advance of their execution.&lt;/p&gt;  &lt;p&gt;When talking about “the simplest thing that works” we have to be careful to not be playing checkers.&amp;#160; Play chess instead.&amp;#160; Make a small, single move that moves you closer to some strategic end.&amp;#160; Like it or not, many waterfall processes are playing chess – trying to anticipate every outcome or piece of functionality and adjust/account for it. What the waterfall practitioner fails to see is the inevitable change.&amp;#160; Many agile adopters start playing checkers, making small move after small move, assuaging fears of downstream problems with the comfort that their doing the simplest thing that works.&lt;/p&gt;  &lt;p&gt;Therefore, have a strategy, a end in mind, and then do the simplest thing that works that moves you closer to that end.&amp;#160; Note however that this may not always be the absolute simplest thing that works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55956" width="1" height="1"&gt;</description><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/Musings/default.aspx">Musings</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Methodology/default.aspx">Methodology</category></item><item><title>Confessions of a First Time Manager</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/12/12/confessions-of-a-first-time-manager.aspx</link><pubDate>Sun, 13 Dec 2009 04:10:39 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54463</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>24</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=54463</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/12/12/confessions-of-a-first-time-manager.aspx#comments</comments><description>&lt;p&gt;Many months ago I wrote &lt;a href="http://devlicio.us/blogs/tim_barcz/archive/2009/03/05/improving-software-process-a-letter-to-upper-management.aspx"&gt;a letter to upper management&lt;/a&gt; about principles of software development and the ways in which should build software.&amp;#160; Since that time my role has changed within the company and for the first time in my career I’m managing a significant number of people (at a previous company I was an R&amp;amp;D Manager but the team was much smaller).&lt;/p&gt;  &lt;p&gt;Below are a few observances/realizations I’ve had in the months since I’ve made the transition that I want to share with you:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Just cause you’re the manager doesn’t mean you know everything&lt;/strong&gt; – Just because someone has tapped you to lead the team doesn’t mean “you’ve arrived”.&amp;#160; You don’t automatically go from individual contributor to all-knowing edict maker.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Don’t Relax/Stay involved&lt;/strong&gt; – Too many managers think because they’ve “arrived” they no longer need to keep pushing themselves. They think they are afforded some special privileges or don’t have to abide by the same rules others are held to. Not wise. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Rely on your team&lt;/strong&gt; – This one is often hard.&amp;#160; It was likely your contributions as in individual contributor that got you noticed for the management position and it’s often hard for an individual contributor accept the role change and not want to tackle challenges individually or continue to contribute.&amp;#160; As a manager you’ll have to rely on your team to see the same level of success as a manager as you presumably did as an individual contributor.&amp;#160; You’re no longer measured on what you do but rather how your entire team performs. This one is admittedly hard for me and I’m growing into this more and more every day. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Build your team &lt;/strong&gt;– As an individual contributor you were primarily responsible for just one person, yourself. As project lead or a team lead you’ll have more responsibility but likely you won’t have people reporting directly to you. As a manager you’re now responsible for everyone on your team and giving them the opportunity to be the best they can. Give people the freedom they need to do great things. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Be honest&lt;/strong&gt; - Don’t lie, shade the truth, or embellish. When you mess up, fess up, I believe the team will respect you more for it. ‘nuff said. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Never ask your team to do something you wouldn’t do yourself&lt;/strong&gt; – Managers who require/ask team members to do something they wouldn’t do themselves are being unfair.&amp;#160; Asking your team to work late while you get to leave every day at 5:00 is an amateur move. Asking the team to give up the weekend might be a necessity at times.&amp;#160; Just make sure if you ask, you’re right there alongside of them. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Don’t be a bottleneck to change&lt;/strong&gt; – The team shouldn’t always move at the speed of the manager. In general just because you don’t understand something doesn’t mean it shouldn’t be adopted. If you cut your teeth on VSS and were a ninja in VB.NET but now your team wants to move all projects to C# and this new thing called Git, don’t blindly say no. Technology moves fast, if you have a trustworthy team, you’re going to have to let go a bit and rely on the team (#3).&amp;#160; Remember, you don’t know everything (#1) and you need build your team (#4), sometimes that may mean doing or trying something you don’t quite understand. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Don’t be afraid to push for change&lt;/strong&gt; – While you shouldn’t be a bottleneck to change you shouldn’t be afraid to push for it either. As a manager you typically have a greater visibility to the team or the process and if you see something that could be improved you shouldn’t necessarily wait for someone on your team to bring it forward. You’re still part of the team &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Hiring/Firing Sucks&lt;/strong&gt; – Movies make firing seem like an easy thing to do and an ego-boosting power-trip. It couldn’t be further from the truth. The days I’ve had to let people go I’ve rarely slept the night before. There’s nothing enjoyable about the process of taking away someone’s livelihood. Hiring can be fun, but most often it’s time consuming and all the time you spend interviewing is wasted except on the one person you hire. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;You’ll notice that many are intertwined and I think at the heart of many of these is pride.&amp;#160; Pride is a dangerous beast, avoid it at all costs. Whether it means you have a trusted friend or colleague keep you in-check or you do frequent self-assessments, don’t let pride seep it.&lt;/p&gt;  &lt;p&gt;Please note that these are my personal observances that I’ve taken mental note of while on this journey. Your mileage may vary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54463" width="1" height="1"&gt;</description><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/Improvement/default.aspx">Improvement</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Musings/default.aspx">Musings</category></item><item><title>Don't Overcomplicate The Issue</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/02/03/don-t-overcomplicate-the-issue.aspx</link><pubDate>Tue, 03 Feb 2009 16:00:06 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43954</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=43954</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/02/03/don-t-overcomplicate-the-issue.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;" height="184" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tim_5F00_barcz/image_5F00_thumb.png" width="214" align="right" border="0" /&gt;&lt;/a&gt; I felt compelled to write after seeing this very same issue come up twice in the last week or so, once for a fellow developer and today for me.&lt;/p&gt;  &lt;h2&gt;The Problem&lt;/h2&gt;  &lt;p&gt;We use a DataSet for assistance with testing our data layer (think &lt;a href="http://code.google.com/p/ndbunit/"&gt;NDBUnit&lt;/a&gt;).&amp;#160; The problem we have is that when you generate the DataSet the XSD created contains all these table adapters that bloat the file, in our app the file bloats to about five times the regular size.&amp;#160; We&amp;#39;ve found that deleting the table adapters on the file makes the file open up so much faster.&amp;#160; However, every time we make a change to the database schema we have to regenerate the DataSet so that it matches the schema.&amp;#160; As the table count has grown deleting these table adapters by hand has grown wearisome.&amp;#160; All this is merely set up for me over-fixing the problem.&lt;/p&gt;  &lt;h2&gt;My First (Wrong) Thought&lt;/h2&gt;  &lt;p&gt;I thought to myself, &amp;quot;hey this is XML I&amp;#39;ll just load up and XML document and query out the nodes (TableAdapters) I don&amp;#39;t need and remove them from the document and save it back.&amp;quot;&amp;#160; While writing a quick bit of code I found writing more code than I needed (at this point I was only at 6 lines).&amp;#160; Despite the file being XML, I don&amp;#39;t need to treat it as XML.&amp;#160; Understand that nothing about getting rid of the TableAdapters relies on the &amp;quot;XML-ness&amp;quot; of the file, it&amp;#39;s all just text. Reminding myself of that...here&amp;#39;s what I came up with...&lt;/p&gt;  &lt;h2&gt;The Second (Correct) Solution&lt;/h2&gt;  &lt;p&gt;Simply treat the file as text and remove the piece you need, the only caveat is that I&amp;#39;m dealing with XML and so if I remove a &amp;quot;piece&amp;quot; I have to remove the whole &amp;quot;piece&amp;quot; (where &amp;quot;piece&amp;quot; means XmlNode).&amp;#160; The solution below simply matches TableAdapter nodes and replaces them with empty text.&amp;#160; Simple.&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; var path = &lt;span style="color:#006080;"&gt;@&amp;quot;C:\dev\sandbox\Website\src\IntegrationTests\TestData\Database.xsd&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;   2:&lt;/span&gt; var text = File.ReadAllText(path);&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; File.WriteAllText(path, Regex.Replace(text, &lt;span style="color:#006080;"&gt;&amp;quot;&amp;lt;TableAdapter.*?&amp;gt;.*?&amp;lt;/TableAdapter&amp;gt;&amp;quot;&lt;/span&gt;, &lt;span style="color:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, RegexOptions.Singleline));&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2&gt;The Point&lt;/h2&gt;

&lt;p&gt;The point is the first solution, while correct, was more complex than it needed to be.&amp;#160; Using a little bit of RegEx to wipe clean certain nodes, I get exactly what I want in three lines of code.&amp;#160; Moral of the story?&amp;#160; &lt;strong&gt;Don&amp;#39;t overcomplicate what doesn&amp;#39;t need to be.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=43954" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Tips+And+Tricks/default.aspx">Tips And Tricks</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Common+Sense/default.aspx">Common Sense</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Musings/default.aspx">Musings</category></item></channel></rss>