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. The Lounge
  3. OG was right all along

OG was right all along

Scheduled Pinned Locked Moved The Lounge
c++question
42 Posts 19 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.
  • D den2k88

    At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).

    GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

    W Offline
    W Offline
    W Balboos GHB
    wrote on last edited by
    #2

    while(you believe this) {
    Nope; // we don't need the extra linees
    } // while(you believe this)

    Ravings en masse^

    "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

    "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

    D 1 Reply Last reply
    0
    • W W Balboos GHB

      while(you believe this) {
      Nope; // we don't need the extra linees
      } // while(you believe this)

      Ravings en masse^

      "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

      "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

      D Offline
      D Offline
      den2k88
      wrote on last edited by
      #3

      Worst thing I (very recently) saw: blocks indentated K&R with a blank line after each block opening, as in

      while (something){

      code
      

      }

      if (something){

      code
      

      }

      Why use the K&R style at all if the code is not more compact anyway??

      GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

      W 1 Reply Last reply
      0
      • D den2k88

        At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).

        GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #4

        A little late to the game, aintcha?

        1 Reply Last reply
        0
        • D den2k88

          Worst thing I (very recently) saw: blocks indentated K&R with a blank line after each block opening, as in

          while (something){

          code
          

          }

          if (something){

          code
          

          }

          Why use the K&R style at all if the code is not more compact anyway??

          GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

          W Offline
          W Offline
          W Balboos GHB
          wrote on last edited by
          #5

          So, I suppose your point is that if one misuses something it doesn't work as planned. Why am I not surprised?

          Ravings en masse^

          "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

          "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

          1 Reply Last reply
          0
          • D den2k88

            At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).

            GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

            Greg UtasG Offline
            Greg UtasG Offline
            Greg Utas
            wrote on last edited by
            #6

            I use Allman because I often find that horizontal space is wasted and vertical space is used miserly. A condition is important, so it should stand out and be easy to read, and putting the left brace on the next line helps with that.

            Robust Services Core | Software Techniques for Lemmings | Articles
            The fox knows many things, but the hedgehog knows one big thing.

            <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
            <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

            P 1 Reply Last reply
            0
            • D den2k88

              At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).

              GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

              J Offline
              J Offline
              Jorgen Andersson
              wrote on last edited by
              #7

              If I recall correctly, OG is a fan of Wintersmith

              Wrong is evil and must be defeated. - Jeff Ello

              OriginalGriffO 1 Reply Last reply
              0
              • J Jorgen Andersson

                If I recall correctly, OG is a fan of Wintersmith

                Wrong is evil and must be defeated. - Jeff Ello

                OriginalGriffO Offline
                OriginalGriffO Offline
                OriginalGriff
                wrote on last edited by
                #8

                Well, it was a good album, and an excellent pTerry book ... :-D

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                J F 2 Replies Last reply
                0
                • OriginalGriffO OriginalGriff

                  Well, it was a good album, and an excellent pTerry book ... :-D

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                  J Offline
                  J Offline
                  Jorgen Andersson
                  wrote on last edited by
                  #9

                  :) I suppose you're a fan of whitesmith as well.

                  Wrong is evil and must be defeated. - Jeff Ello

                  1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    Well, it was a good album, and an excellent pTerry book ... :-D

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                    F Offline
                    F Offline
                    Forogar
                    wrote on last edited by
                    #10

                    I miss TP - and I'm not talking about tp.

                    - I would love to change the world, but they won’t give me the source code.

                    J 1 Reply Last reply
                    0
                    • D den2k88

                      At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).

                      GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

                      S Offline
                      S Offline
                      Slacker007
                      wrote on last edited by
                      #11

                      Don't you know what this will do to Griff's ego if you publicly declare him "right all along". :sigh:

                      OriginalGriffO 1 Reply Last reply
                      0
                      • Greg UtasG Greg Utas

                        I use Allman because I often find that horizontal space is wasted and vertical space is used miserly. A condition is important, so it should stand out and be easy to read, and putting the left brace on the next line helps with that.

                        Robust Services Core | Software Techniques for Lemmings | Articles
                        The fox knows many things, but the hedgehog knows one big thing.

                        P Offline
                        P Offline
                        PIEBALDconsult
                        wrote on last edited by
                        #12

                        Vertical space means I can make notes and such.

                        Greg UtasG 1 Reply Last reply
                        0
                        • P PIEBALDconsult

                          Vertical space means I can make notes and such.

                          Greg UtasG Offline
                          Greg UtasG Offline
                          Greg Utas
                          wrote on last edited by
                          #13

                          Notes where, on your fanfold printout?! :laugh:

                          Robust Services Core | Software Techniques for Lemmings | Articles
                          The fox knows many things, but the hedgehog knows one big thing.

                          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                          P D 2 Replies Last reply
                          0
                          • D den2k88

                            At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).

                            GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

                            F Offline
                            F Offline
                            fd9750
                            wrote on last edited by
                            #14

                            I agree completely, whoever came up with K&R style ( probably K&R ) were out of their mind, no matter whatever other brilliant stuff they came up with. What could be better than:

                            { // this is where we do stuff for whatever reason
                            ...
                            ...
                            }

                            Greg UtasG 1 Reply Last reply
                            0
                            • Greg UtasG Greg Utas

                              Notes where, on your fanfold printout?! :laugh:

                              Robust Services Core | Software Techniques for Lemmings | Articles
                              The fox knows many things, but the hedgehog knows one big thing.

                              P Offline
                              P Offline
                              PIEBALDconsult
                              wrote on last edited by
                              #15

                              Pshaw! Legal-sized sheets, half-inch margins, duh.

                              Greg UtasG 1 Reply Last reply
                              0
                              • P PIEBALDconsult

                                Pshaw! Legal-sized sheets, half-inch margins, duh.

                                Greg UtasG Offline
                                Greg UtasG Offline
                                Greg Utas
                                wrote on last edited by
                                #16

                                I don't remember the last time I printed code off! My guess would be 1999. :laugh:

                                Robust Services Core | Software Techniques for Lemmings | Articles
                                The fox knows many things, but the hedgehog knows one big thing.

                                <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                B 1 Reply Last reply
                                0
                                • F fd9750

                                  I agree completely, whoever came up with K&R style ( probably K&R ) were out of their mind, no matter whatever other brilliant stuff they came up with. What could be better than:

                                  { // this is where we do stuff for whatever reason
                                  ...
                                  ...
                                  }

                                  Greg UtasG Offline
                                  Greg UtasG Offline
                                  Greg Utas
                                  wrote on last edited by
                                  #17

                                  Their 8-space (tab) indentation is worse. Despicable, in fact.

                                  Robust Services Core | Software Techniques for Lemmings | Articles
                                  The fox knows many things, but the hedgehog knows one big thing.

                                  <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                  <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                  F G 2 Replies Last reply
                                  0
                                  • Greg UtasG Greg Utas

                                    Their 8-space (tab) indentation is worse. Despicable, in fact.

                                    Robust Services Core | Software Techniques for Lemmings | Articles
                                    The fox knows many things, but the hedgehog knows one big thing.

                                    F Offline
                                    F Offline
                                    fd9750
                                    wrote on last edited by
                                    #18

                                    I didn't know about that one but yes 'despicable' would be the only valid term I can imagine. :sigh:

                                    1 Reply Last reply
                                    0
                                    • S Slacker007

                                      Don't you know what this will do to Griff's ego if you publicly declare him "right all along". :sigh:

                                      OriginalGriffO Offline
                                      OriginalGriffO Offline
                                      OriginalGriff
                                      wrote on last edited by
                                      #19

                                      It's cool - I don't believe a word of it! :laugh:

                                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                      P 1 Reply Last reply
                                      0
                                      • F Forogar

                                        I miss TP - and I'm not talking about tp.

                                        - I would love to change the world, but they won’t give me the source code.

                                        J Offline
                                        J Offline
                                        Jorgen Andersson
                                        wrote on last edited by
                                        #20

                                        You'd miss tp as well if it were gone.

                                        Wrong is evil and must be defeated. - Jeff Ello

                                        D 1 Reply Last reply
                                        0
                                        • OriginalGriffO OriginalGriff

                                          It's cool - I don't believe a word of it! :laugh:

                                          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                                          P Offline
                                          P Offline
                                          PIEBALDconsult
                                          wrote on last edited by
                                          #21

                                          Riiiight...

                                          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