<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Just say &#8220;No!&#8221; to C# Regions?  Really?!</title>
	<atom:link href="http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/</link>
	<description>ASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.</description>
	<lastBuildDate>Mon, 15 Mar 2010 11:52:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sth_Weird</title>
		<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/comment-page-1/#comment-2099</link>
		<dc:creator>sth_Weird</dc:creator>
		<pubDate>Mon, 27 Apr 2009 15:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/#comment-2099</guid>
		<description>I see a lot of posts saying &quot;this and that tool will group your properties/function etc. anyway&quot; and things like that.
We don&#039;t have StyleCop or anything similar in our company. 
I don&#039;t know StyleCop or any other of those tools, but I guess they are either expensive or they are freeware and we are not allowed to use freeware unless authorized by our it-security department and we won&#039;t buy tools that we actually don&#039;t need. And I&#039;m surely not going to buy any of those tools for private use. 
So people who insist on not using regions, pointing to tools that order or structure your code should keep in mind that if you really produce &quot;nice&quot; code then you should not need this tools, and actually that&#039;s the main argument against regions, because they might hide bad code or be useless because you should not need to group constructors etc. with them.</description>
		<content:encoded><![CDATA[<p>I see a lot of posts saying &#8220;this and that tool will group your properties/function etc. anyway&#8221; and things like that.<br />
We don&#8217;t have StyleCop or anything similar in our company.<br />
I don&#8217;t know StyleCop or any other of those tools, but I guess they are either expensive or they are freeware and we are not allowed to use freeware unless authorized by our it-security department and we won&#8217;t buy tools that we actually don&#8217;t need. And I&#8217;m surely not going to buy any of those tools for private use.<br />
So people who insist on not using regions, pointing to tools that order or structure your code should keep in mind that if you really produce &#8220;nice&#8221; code then you should not need this tools, and actually that&#8217;s the main argument against regions, because they might hide bad code or be useless because you should not need to group constructors etc. with them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike V</title>
		<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/comment-page-1/#comment-2067</link>
		<dc:creator>Mike V</dc:creator>
		<pubDate>Thu, 23 Apr 2009 18:28:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/#comment-2067</guid>
		<description>In seriousness though, StyleCop actually discourages using #regions.  I&#039;m not exactly sure why, though.  I wish that StyleCop had explanations for each of their style decisions.</description>
		<content:encoded><![CDATA[<p>In seriousness though, StyleCop actually discourages using #regions.  I&#8217;m not exactly sure why, though.  I wish that StyleCop had explanations for each of their style decisions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike V</title>
		<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/comment-page-1/#comment-2066</link>
		<dc:creator>Mike V</dc:creator>
		<pubDate>Thu, 23 Apr 2009 18:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/#comment-2066</guid>
		<description>It&#039;s fine to use #regions to hide bad code, as long as you type &quot;Bad Code In Here&quot; as your region text.  I use them to hide the sloppy, inefficient parts of my algorithms.  It leads to code that is much more readable and elegant-looking.</description>
		<content:encoded><![CDATA[<p>It&#8217;s fine to use #regions to hide bad code, as long as you type &#8220;Bad Code In Here&#8221; as your region text.  I use them to hide the sloppy, inefficient parts of my algorithms.  It leads to code that is much more readable and elegant-looking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sth_Weird</title>
		<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/comment-page-1/#comment-2059</link>
		<dc:creator>sth_Weird</dc:creator>
		<pubDate>Thu, 23 Apr 2009 06:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/#comment-2059</guid>
		<description>I totally agree with you!
I use regions the same way your collegue does. When I want to add a new property, field, event etc. in my file, it&#039;s simply the easiest way to go that region. I&#039;ve seen collegues, who are actually good programmers when you look at the result, but never look at their code, there&#039;s no structure in it, there are events between properties and functions between constructors, just because they added them right where the cursor was when they wrote them. 
Of course, you do not need regions to organize your code. But as you said,...do you really want to see the the events and constructors and variables when you edit your properties? I don&#039;t. And even if you grouped your code so that the constructors come before the properties and after that the functions...if you have a lot of them, you still have to look through all of them to find what you need, it&#039;s much easier to simply open the region. For me, the only reason not to use regions is that you do not want your code to be organized (if somebody else looks at your code it of course looks much more impressive and complex if he sees hundreds of functions, than three or four regions), you want it to look complicated, or you are too lazy to keep it organized.</description>
		<content:encoded><![CDATA[<p>I totally agree with you!<br />
I use regions the same way your collegue does. When I want to add a new property, field, event etc. in my file, it&#8217;s simply the easiest way to go that region. I&#8217;ve seen collegues, who are actually good programmers when you look at the result, but never look at their code, there&#8217;s no structure in it, there are events between properties and functions between constructors, just because they added them right where the cursor was when they wrote them.<br />
Of course, you do not need regions to organize your code. But as you said,&#8230;do you really want to see the the events and constructors and variables when you edit your properties? I don&#8217;t. And even if you grouped your code so that the constructors come before the properties and after that the functions&#8230;if you have a lot of them, you still have to look through all of them to find what you need, it&#8217;s much easier to simply open the region. For me, the only reason not to use regions is that you do not want your code to be organized (if somebody else looks at your code it of course looks much more impressive and complex if he sees hundreds of functions, than three or four regions), you want it to look complicated, or you are too lazy to keep it organized.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Schinkel</title>
		<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/comment-page-1/#comment-2033</link>
		<dc:creator>Dave Schinkel</dc:creator>
		<pubDate>Mon, 20 Apr 2009 02:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/#comment-2033</guid>
		<description>Whoever says regions are not to be used, I&#039;d love to see your code.  I bet you it&#039;s a mess and the reason you don&#039;t like regions is because the developers on your team has abused use of them and that there is no logical pattern or team standard established.

I&#039;ve been on plenty of teams who have used regions effectively and at a top level grouping that made classes and finding things much faster overall.  I definitely agree that unorganized use of regions and overuse should not be, but to say not to use regions at all is like saying put all of your damn html on one line and don&#039;t indent...another thing I can&#039;t read.

If you have a team who can&#039;t use regions effectively it&#039;s either because

1) They don&#039;t care about team standards
2) There is no pattern in place and standard that expected of the team
3) There are no code reviews to help keep that standard and pattern in place

there is absolutely no excuse to say that regions are not helpful.  It&#039;s called a standard people and reviews.  It&#039;s called caring about code structure which goes along with namespacing, file structure of you project, and pattern structure of your code.  To single out regions is foolish and only means you can&#039;t figure out a standard practice on your team and template to force and use that is top level..simple as this:

#region Methods
#region Properties
#region CRUDs

who wants to scroll down a class all the time when you can go to a region quickly to find what you want as a starting point.  And your classes should never be very long (SOLID) but still, regions do help.  If Code Generation did not use regions, can you imagine?  Granted I am not using code generated code now but was and it was nice.

I always use regions and always will, they are not chaos in my application so they are extremely useful when not used like a code &amp; run team who has no clue of standards or patterns.</description>
		<content:encoded><![CDATA[<p>Whoever says regions are not to be used, I&#8217;d love to see your code.  I bet you it&#8217;s a mess and the reason you don&#8217;t like regions is because the developers on your team has abused use of them and that there is no logical pattern or team standard established.</p>
<p>I&#8217;ve been on plenty of teams who have used regions effectively and at a top level grouping that made classes and finding things much faster overall.  I definitely agree that unorganized use of regions and overuse should not be, but to say not to use regions at all is like saying put all of your damn html on one line and don&#8217;t indent&#8230;another thing I can&#8217;t read.</p>
<p>If you have a team who can&#8217;t use regions effectively it&#8217;s either because</p>
<p>1) They don&#8217;t care about team standards<br />
2) There is no pattern in place and standard that expected of the team<br />
3) There are no code reviews to help keep that standard and pattern in place</p>
<p>there is absolutely no excuse to say that regions are not helpful.  It&#8217;s called a standard people and reviews.  It&#8217;s called caring about code structure which goes along with namespacing, file structure of you project, and pattern structure of your code.  To single out regions is foolish and only means you can&#8217;t figure out a standard practice on your team and template to force and use that is top level..simple as this:</p>
<p>#region Methods<br />
#region Properties<br />
#region CRUDs</p>
<p>who wants to scroll down a class all the time when you can go to a region quickly to find what you want as a starting point.  And your classes should never be very long (SOLID) but still, regions do help.  If Code Generation did not use regions, can you imagine?  Granted I am not using code generated code now but was and it was nice.</p>
<p>I always use regions and always will, they are not chaos in my application so they are extremely useful when not used like a code &amp; run team who has no clue of standards or patterns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Stevenson-Leggett</title>
		<link>http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/comment-page-1/#comment-2011</link>
		<dc:creator>Rob Stevenson-Leggett</dc:creator>
		<pubDate>Thu, 16 Apr 2009 12:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2009/04/16/just-say-no-to-c-regions-really/#comment-2011</guid>
		<description>I agree with you 100%

Regions are good. However like almost anything they can be used badly.

I&#039;ve lost count of the times I&#039;ve seen region groupings like

#region Don&#039;t know what these are for

or 

#region Not used

or 

#region Old code

or

#region Steve&#039;s Code

or

#region Calculations for SomeMethod

The reason these are bad is the same reason that comments like this are bad. If the code changes, the regions don&#039;t make any sense.

Like any construct regions should be used with care. I think the pattern you observe here is the only real correct one. I&#039;d even go as far as to say that there should be an option to autogenerate for these regions in resharper with remove/add functionality with no other regions allowed.</description>
		<content:encoded><![CDATA[<p>I agree with you 100%</p>
<p>Regions are good. However like almost anything they can be used badly.</p>
<p>I&#8217;ve lost count of the times I&#8217;ve seen region groupings like</p>
<p>#region Don&#8217;t know what these are for</p>
<p>or </p>
<p>#region Not used</p>
<p>or </p>
<p>#region Old code</p>
<p>or</p>
<p>#region Steve&#8217;s Code</p>
<p>or</p>
<p>#region Calculations for SomeMethod</p>
<p>The reason these are bad is the same reason that comments like this are bad. If the code changes, the regions don&#8217;t make any sense.</p>
<p>Like any construct regions should be used with care. I think the pattern you observe here is the only real correct one. I&#8217;d even go as far as to say that there should be an option to autogenerate for these regions in resharper with remove/add functionality with no other regions allowed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.227 seconds -->
