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. General Programming
  3. Visual Studio
  4. AAHHH #if/else/endif placement in Visual Studio

AAHHH #if/else/endif placement in Visual Studio

Scheduled Pinned Locked Moved Visual Studio
csharpvisual-studioquestion
6 Posts 2 Posters 0 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.
  • M Offline
    M Offline
    Mike Marynowski
    wrote on last edited by
    #1

    This is driving me up the wall and I can't find a solution. The C# code editor property places #region directives, but #if/else/endif directives always jump to the beginning of the line instead of the current indentation level. What gives? Any way to change the default??

    L 1 Reply Last reply
    0
    • M Mike Marynowski

      This is driving me up the wall and I can't find a solution. The C# code editor property places #region directives, but #if/else/endif directives always jump to the beginning of the line instead of the current indentation level. What gives? Any way to change the default??

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Mike Marynowski wrote:

      #if/else/endif directives always jump to the beginning of the line instead of the current indentation level.

      I always think that is the best way, so you can clearly see where some code may be parsed out by the preprocessor.

      M 1 Reply Last reply
      0
      • L Lost User

        Mike Marynowski wrote:

        #if/else/endif directives always jump to the beginning of the line instead of the current indentation level.

        I always think that is the best way, so you can clearly see where some code may be parsed out by the preprocessor.

        M Offline
        M Offline
        Mike Marynowski
        wrote on last edited by
        #3

        I disagree. It just looks stupid when you have code indented 5 or 6 tabs (i.e. deep in a nested loop) and the compiler directives are at the beginning of the line. It becomes difficult to see what lines are even affected at that point. Seeing what code is parsed out is easy because visual studio grays out and collapses the region. Either way it just looks messy...I much rather have them indented like the region tags.

        L 1 Reply Last reply
        0
        • M Mike Marynowski

          I disagree. It just looks stupid when you have code indented 5 or 6 tabs (i.e. deep in a nested loop) and the compiler directives are at the beginning of the line. It becomes difficult to see what lines are even affected at that point. Seeing what code is parsed out is easy because visual studio grays out and collapses the region. Either way it just looks messy...I much rather have them indented like the region tags.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Mike Marynowski wrote:

          I disagree. It just looks stupid

          Yes, but these things are just based on personal preference; as with most things there is no right and wrong.

          M 1 Reply Last reply
          0
          • L Lost User

            Mike Marynowski wrote:

            I disagree. It just looks stupid

            Yes, but these things are just based on personal preference; as with most things there is no right and wrong.

            M Offline
            M Offline
            Mike Marynowski
            wrote on last edited by
            #5

            Of course...I'm not suggesting your wrong...just disagreeing that it is better and citing my reasons.

            L 1 Reply Last reply
            0
            • M Mike Marynowski

              Of course...I'm not suggesting your wrong...just disagreeing that it is better and citing my reasons.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Mike Marynowski wrote:

              just disagreeing that it is better and citing my reasons.

              My bad; my original wording should have said "my preference" rather than "best".

              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