ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Indentation Style

    Developer Discussion
    6
    8
    801
    Loading More Posts
    • 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.
    • pmonchoP
      pmoncho
      last edited by

      Just wondering what many of the scripters and developers here like to use as their Indentation Style?

      I was looking at my pretty messed up .PS1 scripts and trying to figure out which of the styles from https://en.wikipedia.org/wiki/Indentation_style
      would make my scripts look more organized.

      I find I am partial to Allman style. It seems that code blocks are more noticeable and finding a missing bracket seems easier.

      DashrenderD 1 Reply Last reply Reply Quote 0
      • DashrenderD
        Dashrender @pmoncho
        last edited by

        @pmoncho said in Indentation Style:

        Just wondering what many of the scripters and developers here like to use as their Indentation Style?

        I was looking at my pretty messed up .PS1 scripts and trying to figure out which of the styles from https://en.wikipedia.org/wiki/Indentation_style
        would make my scripts look more organized.

        I find I am partial to Allman style. It seems that code blocks are more noticeable and finding a missing bracket seems easier.

        wow - that's a lot of options.

        I think I like whitesmith personally.

        pmonchoP 1 Reply Last reply Reply Quote 0
        • pmonchoP
          pmoncho @Dashrender
          last edited by

          @dashrender said in Indentation Style:

          @pmoncho said in Indentation Style:

          Just wondering what many of the scripters and developers here like to use as their Indentation Style?

          I was looking at my pretty messed up .PS1 scripts and trying to figure out which of the styles from https://en.wikipedia.org/wiki/Indentation_style
          would make my scripts look more organized.

          I find I am partial to Allman style. It seems that code blocks are more noticeable and finding a missing bracket seems easier.

          wow - that's a lot of options.

          I think I like whitesmith personally.

          I didn't know till I looked also.

          Whitesmith is nice too. Hmmm... decisions...decisions...

          I am partial to using Tab's instead of space bar four times. Apparently this is a full-on debate about using Tab's that I did not know about either.

          JaredBuschJ 1 Reply Last reply Reply Quote 1
          • JaredBuschJ
            JaredBusch @pmoncho
            last edited by

            @pmoncho tab indentation needs to die in nuclear fire.

            Thankfully, modern IDE systems like Visual Studio Code and others all auto swap a tab for 4 spaces by default.

            Personally, I prefer a 2 space indentation, but 4 seems to be the most common.

            EddieJenningsE pmonchoP 2 Replies Last reply Reply Quote 2
            • dafyreD
              dafyre
              last edited by

              I'm more of a fan of K&R .

              I definitely agree with @JaredBusch two spaces for the win.

              1 Reply Last reply Reply Quote 1
              • EddieJenningsE
                EddieJennings @JaredBusch
                last edited by

                @jaredbusch said in Indentation Style:

                @pmoncho tab indentation needs to die in nuclear fire.

                Thankfully, modern IDE systems like Visual Studio Code and others all auto swap a tab for 4 spaces by default.

                Personally, I prefer a 2 space indentation, but 4 seems to be the most common.

                I agree on the demise of tabs. Training on Ansible over the last year has solidified my dislike of tabs.

                1 Reply Last reply Reply Quote 1
                • gjacobseG
                  gjacobse
                  last edited by

                  Good to know. Have to take that into consideration should I get into scripting more.

                  1 Reply Last reply Reply Quote 0
                  • pmonchoP
                    pmoncho @JaredBusch
                    last edited by

                    @jaredbusch said in Indentation Style:

                    @pmoncho tab indentation needs to die in nuclear fire.

                    Thankfully, modern IDE systems like Visual Studio Code and others all auto swap a tab for 4 spaces by default.

                    Personally, I prefer a 2 space indentation, but 4 seems to be the most common.

                    I didn't think Tab's were that big of a deal as I never had an issue between Vi, Nano, Notepad or Notepad++. I guess it is mostly a habit from using text editors.

                    Hmm... I always hated having press the space bar more than twice (only after "." mostly). Maybe I will try using two spaces in the next script to see how that pans out.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post