#region coding
-
hi, what is the difference between writing a code within #region and endregion and wrtiing it normally. why in some programs they write code in between #region and Endregion. Regards Vijay.
Region do not influence the code or execution of the program. It is just a facility to give the code more readable. It is just more easy to read if you have a class with 2000 lines.
La Richesse & la Gloire ne griseront jamais que les temples
-
hi, what is the difference between writing a code within #region and endregion and wrtiing it normally. why in some programs they write code in between #region and Endregion. Regards Vijay.
vijay_83 wrote:
what is the difference between writing a code within #region and endregion and wrtiing it normally.
No difference at all
vijay_83 wrote:
why in some programs they write code in between #region and Endregion.
Organizing methods in regions is always a best practice. Your class will be easy to maintain. And if your class is very big, you will see big scrollbar. This will be tough to the desired function. If your methods are organized in regions, it can be collapsed when it is not in use. This helps to find the desired methods easily.