DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

20
kicks
published 8 months, 17 days ago, submitted by rimsystems rimsystems 8 months, 18 days ago

weblogs.asp.net — Bil Simser argues against using regions in your code.

tags: | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
Summary: "regions are evil since you can find stuff if you use ReSharper."

For those of us not willing (or able) to fork out $199 for an individual license, here's my advice: "go ahead and use regions. Like everything else, it can be abused. Use them wisely and apply corrective measures to junior developers who go region-happy."
posted by cdjaco cdjaco 8 months, 18 days ago
You can also use Regionerate (VS add on) and have predefined XML files that manages how you create your class's regions, so your code's regions are uniformly named and uniformly contains the same items (or so that you can enforce standards of how to use regions, etc.). Regionerate also allows you to put your new methods/properties/fields anywhere and just click Regionerate and it will move it to the correct spot - best of all its free.

Sorry for the plug, Regionerate is one of my favorite VS add ons :)
posted by jamesewelch jamesewelch 8 months, 18 days ago
I use Regionerate, which is high praise since the goddamn thing keeps throwing up an exception when VS loads, and sometimes leaves tons of unmatched #endregions at the end of the file. Other than that, its completely worth it.
posted by yesthatmcgurk yesthatmcgurk 8 months, 18 days ago
That (throwing exceptions on VS load) happened to me a few times, but then it stopped doing that a while ago. Did you check to make sure you have the newest version? I can't remember what I did to make it stop, but maybe I didn't do anything.
posted by jamesewelch jamesewelch 8 months, 18 days ago
The title cracks me... Applying the same logic we could say Airbags == Evil, you don't need them if you drive a military tank :)
posted by drugarce drugarce 8 months, 17 days ago
i feel like these blog entries are just to plug products and get adsense hits. This particular blog doesnt appear to have adsense, but all the same, terrible article. Regions, like any other thing in the world, should be used in moderation. I got more information from the comments before me. thx
posted by bladefist 8 months, 17 days ago
This is one of the most ridiculous posts that I have ever seen on this site. It's nothing more than a pointless rant.

What I do to circumvent this issue is wait until I'm [near] complete with my code before adding regions. If later, I have to add a new method or something, it's really not a big deal to cut and paste the code and put it into the correct region.
posted by senfo 8 months, 17 days ago
@yesthatmcgurk:

Regionerate is still in beta, so I guess these kind of things cannot be avoided. Are you using the latest version?
If you are using the latest version, how about sending a bug report in the project website? could help...
posted by rauchy rauchy 8 months, 17 days ago
I use ReSharper and I still think regions are important. I am working with an app handed off by a consultant and the only thing I would say i don't like about regioning is when one region is used to encapsulate the entire class... seems rather pointless; but what do you expect from a consultant?

If you use standard properties { return _value; } { _blah = value; }; put all the properites in a region and keep it closed... i can look at the private vars for reference.
posted by brianjlowry brianjlowry 8 months, 17 days ago
? Regions == Evil
False

Maybe he meant to assign Evil to Regions, rather than comparing them? =)
posted by aquinas 8 months, 17 days ago
Simser also boasts how him and his team like to refactor their deliverables the day before they're due. I guess that's being super-agile or something.
posted by foobar 8 months, 2 days ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge