By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,500 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

Who is really need #Regions inside methods?

P: n/a
Hi, everybody,

I'm just wondering if someone really need stuff like this:
http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than
explain, please.

Thanks!

Gaidar
Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

"gaidar" <ga****@vbstreets.ru> wrote in message
news:ON**************@TK2MSFTNGP14.phx.gbl...
Hi, everybody,

I'm just wondering if someone really need stuff like this:
http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than
explain, please.


I've been too busy to keep up with what is proposed for VS2005.
But in VS2003, Regions "within" a method are not supported.
I find myself using them quite a bit, especially because I miss the Single
Procedure view of VB6.
I group related things, such as all the properties of a Class, and other
related procedures.
Keep things grouped, when they're finished off, just collapse them.
In rare cases, such as very long and complex methods where refactoring just
isn't appropriate, I think I would like the option to have regions "within"
a method as well.

Personally, I like them. However, with the proposed ability to break classes
into seperate files, I might choose that instead. If I had a Single
Procedure view still, I would probably use Regions less.

Gerald
Nov 21 '05 #2

P: n/a
"gaidar" <ga****@vbstreets.ru> schrieb:
I'm just wondering if someone really need stuff like this:
http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than
explain, please.


Personally I don't need them. I almost never use regions.

BTW: The link you posted is pointing to the index and not to a specific
topic.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
I agree, they can definitely make code more organized. If a Class is very
long it can make editing code much easier by allowing you to fit the
procedures you are editing on your screen at the same time. Some people
might argue that this can be done without using #Region, which is true, but
when you have a large amount of related declarations or many small
procedures that are related to each other, it can be nice to have them
shrunken to a line that is a little more descriptive than the actual
declarations. I will admit that I have not yet used them, but I am also a
bit of an amature who uses VB.NET only for ASP.NET. But even if I don't use
them much in my own code, I am very glad they exist because the code that is
automatically generated by Visual Studio is usually put in a #Region, and
without that I would have to scroll down to find my own code in every page
every time I opened one, and as I mentioned, the descriptive part helps me
know why the automatically generated code is there.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Gerald Hernandez" <Cablewizard@sp*********@Yahoo.com> wrote in message
news:eT**************@TK2MSFTNGP14.phx.gbl...

"gaidar" <ga****@vbstreets.ru> wrote in message
news:ON**************@TK2MSFTNGP14.phx.gbl...
Hi, everybody,

I'm just wondering if someone really need stuff like this:
http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than
explain, please.


I've been too busy to keep up with what is proposed for VS2005.
But in VS2003, Regions "within" a method are not supported.
I find myself using them quite a bit, especially because I miss the Single
Procedure view of VB6.
I group related things, such as all the properties of a Class, and other
related procedures.
Keep things grouped, when they're finished off, just collapse them.
In rare cases, such as very long and complex methods where refactoring
just
isn't appropriate, I think I would like the option to have regions
"within"
a method as well.

Personally, I like them. However, with the proposed ability to break
classes
into seperate files, I might choose that instead. If I had a Single
Procedure view still, I would probably use Regions less.

Gerald

Nov 21 '05 #4

P: n/a

Sorry, I made a mistake.

I've got a few new links:

http://lab.msdn.microsoft.com/produc...e-5fa0c56344d0
http://lab.msdn.microsoft.com/produc...0-4d685dccd4d8

Gaidar
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"gaidar" <ga****@vbstreets.ru> schrieb:
I'm just wondering if someone really need stuff like this:
http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than
explain, please.


Personally I don't need them. I almost never use regions.

BTW: The link you posted is pointing to the index and not to a specific
topic.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

P: n/a
Hi,

I think it would be nice to have.
Some functions or subs are so big that i would like to structure them a
bit with #Regions.
p.s. I use it a lot, and it makes long code much more readable, and
easier to find things back.

Regards
Peter

gaidar wrote:
Hi, everybody,

I'm just wondering if someone really need stuff like this:
http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than
explain, please.

Thanks!

Gaidar

Nov 21 '05 #6

P: n/a
"Peter Verijke" <pe***@verijke.com> schrieb:
Some functions or subs are so big that i would like to structure them a
bit with #Regions.
p.s. I use it a lot, and it makes long code much more readable, and
easier to find things back.


Maybe you should refactor your code :-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #7

P: n/a
Herfried,

Maybe you should refactor your code :-).

--

You won't believe it, I had the same idea as you reading this thread,

:-)

Cor
Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.