Wednesday 30 May 2007

Regions in .NET

As a fan of agile development, where everything should be structured into small classes, its hard to see regions as anything but a bad solution for a bad problem. But they are here, and people are using them, so no sense in not knowing what they do. Its a simple answer:

They do nothing, zip, nada. A region is simply a construct to enable Visual Studio.NET to hide pieces of code outside of the normal bounderies of methods, structures and classes.

In vb.net a region have the following for:
#Region "DataTypes"
' types of service:
#End Region

And in c#:

#region "DataTypes"
// types of service:
#endregion

So no magic here... Sorry

No comments: