Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. #region coding

#region coding

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijay_83
    wrote on last edited by
    #1

    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.

    M N 2 Replies Last reply
    0
    • V vijay_83

      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.

      M Offline
      M Offline
      Merlin Tintin
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • V vijay_83

        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.

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        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.


        My Website | Ask smart questions

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups