<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Bob Parsons</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/PTrippett/Atom.aspx" />
    <subtitle type="html"> Do as I say, not do as I do</subtitle>
    <id>http://geekswithblogs.net/PTrippett/Default.aspx</id>
    <author>
        <name>Bob Parsons</name>
        <uri>http://geekswithblogs.net/PTrippett/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2008-08-27T23:14:06Z</updated>
    <entry>
        <title>C# Regions... When to use them?</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/PTrippett/archive/2008/08/27/c-regions.-when-to-use-them.aspx" />
        <id>http://geekswithblogs.net/PTrippett/archive/2008/08/27/c-regions.-when-to-use-them.aspx</id>
        <published>2008-08-27T23:14:06-12:00:00</published>
        <updated>2012-02-27T07:38:40Z</updated>
        <summary type="html">After reading the comments on my previous post mentioning I liked C# regions and got the general concensus is that these are very bad and evil inventions. I typed "C# Regions" into google and sure enough the first result was titled "C# Regions Considered Harmful" So my next question was why can this little handy things be considered harmful. </summary>
        <content type="html">&lt;p&gt;After reading the comments on my previous post mentioning I liked C# regions and got the general concensus is that these are very bad and evil inventions. I typed "C# Regions" into google and sure enough the first result was titled &lt;a href="http://www.evilrob.org/journal/archives/2006/08/09/c-regions-consi.html"&gt;"&lt;em&gt;C# Regions&lt;/em&gt; Considered Harmful"&lt;/a&gt; So my next question was why can this little handy things be considered harmful. &lt;/p&gt;
&lt;p&gt;I have come to a conclusion and answer is over use. A lingering voice tells me this might open a horrible debate about whether they should or should not be used. End of story is that they exist we have to live with them so heres when I think they should and should not be used.&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;strong&gt;A Region should probably never be used inside a function or contain just one function&lt;/strong&gt; - A simple comment or &amp;lt;summary&amp;gt; block will suffice. If your function seems too big maybe you should consider refactoring. A region could make sense around an interface implementation *if* your class implements more than one interface. &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;A Class should probably never contain just one region&lt;/strong&gt; - Otherwise the region is simply the class (maybe you already have a comment or &amp;lt;summary&amp;gt; block on the class) so thats just duplicating information. &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Place a region around your private variable declarations&lt;/strong&gt; - this is down to your programming style, I place all my private declarations at the top of the class and 99% of the time when i open a file I am modifying a function or property so there is relly no need to see them unless I am creating something new so, for me, it makes sense to place these in a region. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Theres probably a few more maybe this list will grow over time. I am not saying use them in this way, but more if your going to use them think twice and use them wisely.&lt;/p&gt;&lt;img src="http://geekswithblogs.net/PTrippett/aggbug/124742.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/PTrippett/comments/124742.aspx</wfw:comment>
        <slash:comments>8</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/PTrippett/comments/commentRss/124742.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/PTrippett/services/trackbacks/124742.aspx</trackback:ping>
    </entry>
    <entry>
        <title>5 Things to remember when coding in a team</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/PTrippett/archive/2008/08/25/5-things-to-remeber-when-coding-in-a-team.aspx" />
        <id>http://geekswithblogs.net/PTrippett/archive/2008/08/25/5-things-to-remeber-when-coding-in-a-team.aspx</id>
        <published>2008-08-25T18:51:18-12:00:00</published>
        <updated>2008-08-30T08:46:15Z</updated>
        <summary type="html">Whenever I tell one of my developers to do something a certain way I always get asked the question "why? doesnt it just take longer?". Well maybe it takes a little longer but Its not just because i am being a hard ass there is method behind my madness.</summary>
        <content type="html">&lt;p&gt;Whenever I tell one of my developers to do something a certain way I always get asked the question "why? doesnt it just take longer?". Well maybe it takes a little longer but Its not just because i am being a hard ass there is method behind my madness.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Format your code for readability:&lt;/strong&gt;&lt;br /&gt;
Sure, you may understand your code inside out and know exactly what its doing but its may not always be you who has to edit the code. A few extra line breaks, proper tabbing, pretty code makes all the difference when someone else is burdened to read, understand and edit it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Stick to the naming convention:&lt;/strong&gt;&lt;br /&gt;
EUGHStrUPINSET, frmTest, cDataStructures, customerInformation whatever your convention, stick to it, its there so you all understand what a variable does. But IMHO dont let your naming convention be visible on public members stick to Camel Cased strings.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. That super new functionality may be cool but...&lt;/strong&gt;&lt;br /&gt;
Not everyone in your team may not understand it so whereas you maybe an ub3r l33t coder for using it. You just lost 2 days while everyone else now has to learn it. Thanks!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Comment it please:&lt;/strong&gt;&lt;br /&gt;
It may seem straight forward but itsalways nice to know what you intended it to do just incase you wrote it with a hangover and its not doing anything slightly like what it should, if its purpose isnt commented who knows if its right or wrong.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. Put order in your code and use #region #endregion blocks:&lt;/strong&gt;&lt;br /&gt;
Why? For the meer reason I said so, I like it and it makes me happy &lt;img alt="" src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/tounge_smile.gif" /&gt;&lt;/p&gt;&lt;img src="http://geekswithblogs.net/PTrippett/aggbug/124678.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/PTrippett/comments/124678.aspx</wfw:comment>
        <slash:comments>9</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/PTrippett/comments/commentRss/124678.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/PTrippett/services/trackbacks/124678.aspx</trackback:ping>
    </entry>
</feed>
