473,802 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Who is really need #Regions inside methods?

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
7 2738

"gaidar" <ga****@vbstree ts.ru> wrote in message
news:ON******** ******@TK2MSFTN GP14.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
"gaidar" <ga****@vbstree ts.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
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********@hotm ail.com
http://www.nathansokalski.com/

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

"gaidar" <ga****@vbstree ts.ru> wrote in message
news:ON******** ******@TK2MSFTN GP14.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

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******** ********@tk2msf tngp13.phx.gbl. ..
"gaidar" <ga****@vbstree ts.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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3058
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers to have an easier time understanding what I do. Therefore this weekend I'm going to spend 3 days just writing comments. Before I do it, I thought I'd ask other programmers what information they find useful. Below is a typical class I've...
6
1864
by: C# Learner | last post by:
1) How often do you put regions into your code? a) very often b) occasionally c) infrequently d) never 2) If you didn't answer (d), what do you use regions for? a) hiding ugly code
4
2406
by: Simon | last post by:
Just starting on C# and would like to know what suggestions there are for the order in which declarations, event handlers, properties, private code, nested classes, etc, etc appear in your files. What impact do access modifiers have on the order? Also, does anyone use standardised region names?
11
1427
by: julien | last post by:
Hello, I posted this question on the NDoc-user mailing list, but it looks like a dead list (no messages for 10 days!). I'd like to use NDoc tags or custom tags inside methods like: void Mymethod() { ..... <mytag>...</mytag> .... }
131
6232
by: pemo | last post by:
Is C really portable? And, apologies, but this is possibly a little OT? In c.l.c we often see 'not portable' comments, but I wonder just how portable C apps really are. I don't write portable C code - *not only* because, in a 'C sense', I
12
3101
by: Adam Hartshorne | last post by:
Hi All, I was wondering if somebody could post a few lines of code which would produce random colors, which will be used in defining different regions on a mesh. So in addition to having n random colors, I feel that there should also be some condition to ensure that they aren't too similar in appearance, given that is likely to range from 2-20 say. Any help much appreciated,
8
1759
by: Spleenwort | last post by:
With regard to XML comments in c#. I think that #regions should be self-documenting relative to XML comments or that a <region> tag should be defined and auto-inserted when you type #region (blah, blah). Anyone have any suggestions for having regions and their comments show up in XML comments...
7
2575
by: Louis B. (ldb) | last post by:
I have a long running program that eventually crashes when valloc() returns a 0. This program is relatively non-trivial as it's written in Ada, is multithreaded, has alot of SSE routines. A memory leak would be the most obvious cause but this appears to be more sinister then a simple memory leak. After alot of running around and searching through the code I found an anomaly that I'd like to explain and understand if it's the cause of...
3
1237
by: nickels | last post by:
Well im writing a program in java and my program had to do with Sudoku but its only 4 by 4 not 9 by 9. My program checks to see weather the rows, columns, and regions add up to 10. The output would look like this... Enter Row 1: 3 2 4 1 Enter Row 2: 4 1 3 2 Enter Row 3: 1 4 2 3 Enter Row 4: 2 3 1 4 REG-1:GOOD REG-2:GOOD REG-3:GOOD
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.