summary & region

M

Mohd Ebrahim

Hi,

1. what is the difference between ///<Summary> and #region ...#endregion
comment statements in c#.

2. which one to use between the two?

Regards,
 
J

Joe Fawcett

Mohd Ebrahim said:
Hi,

1. what is the difference between ///<Summary> and #region ...#endregion
comment statements in c#.

2. which one to use between the two?

Regards,

The #region is usually used to separate separate sections, for example in a
class you might have regions for Constructors, Properties, Methods, Private
Fields etc. These can be expanded/contracted to ease readability of the code
although a lot of developers don't like them as they can often hide crucial
information.
The /// style comments usually annotate classes and methods, as well as
providing commentary within the code they are used by documentation tools to
produce the modern style help files.
 
H

Hillbilly

The #region construct is used to encapsulate text in the text editor
and --only that specific purpose-- making it possible to expand or collapse
many lines of text making the use of the text editor more efficient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top