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.
  • 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
            • 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

              M Offline
              M Offline
              megaadam
              wrote on last edited by
              #22

              It WAS Griff, and me! But methinks he was advocating Whitesmith's Indentation style - Wikipedia[^]

              if(this->aintUgly())
              {
              thenWhatIs(); // ??
              }

              "If we don't change direction, we'll end up where we're going"

              D 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

                B Offline
                B Offline
                BillWoodruff
                wrote on last edited by
                #23

                Allman all the way, for me. "White space" is cheap, now ... compared to when "real programmers don't eat quiche." [^]

                «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

                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

                  V Offline
                  V Offline
                  Vikram A Punathambekar
                  wrote on last edited by
                  #24

                  Ah, it's been so long since we had a braces war ;) Allman style is awesome, K&R is fugly X| But I like Python even better, where indentation determines scope.

                  Cheers, Vikram.

                  G 1 Reply 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.

                    G Offline
                    G Offline
                    Gary Wheeler
                    wrote on last edited by
                    #25

                    Greg Utas wrote:

                    Despicable, in fact

                    The word 'despicable' is a moral judgment. Given that they invented the brace style at the same time they invented the C programming language, and tabs were 8 spaces wide because of teletypes and other such hardware, a little bit of understanding might be in order.

                    Software Zen: delete this;

                    Greg UtasG 1 Reply Last reply
                    0
                    • V Vikram A Punathambekar

                      Ah, it's been so long since we had a braces war ;) Allman style is awesome, K&R is fugly X| But I like Python even better, where indentation determines scope.

                      Cheers, Vikram.

                      G Offline
                      G Offline
                      Gary Wheeler
                      wrote on last edited by
                      #26

                      Vikram A Punathambekar wrote:

                      I like Python even better, where indentation determines scope

                      You just like to sit back and watch the world burn, don't you? :-D

                      Software Zen: delete this;

                      V 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

                        G Offline
                        G Offline
                        Gary Wheeler
                        wrote on last edited by
                        #27

                        Allman braces are morally, ethically, and spiritually superior to any other brace style, including K&R.

                        Software Zen: delete this;

                        1 Reply Last reply
                        0
                        • G Gary Wheeler

                          Greg Utas wrote:

                          Despicable, in fact

                          The word 'despicable' is a moral judgment. Given that they invented the brace style at the same time they invented the C programming language, and tabs were 8 spaces wide because of teletypes and other such hardware, a little bit of understanding might be in order.

                          Software Zen: delete this;

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

                          I've been known to indulge in hyperbole.

                          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>

                          G 1 Reply Last reply
                          0
                          • Greg UtasG Greg Utas

                            I've been known to indulge in hyperbole.

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

                            G Offline
                            G Offline
                            Gary Wheeler
                            wrote on last edited by
                            #29

                            I prefer parabole myself, but toe-may-toe, toe-mah-toe... :laugh:

                            Software Zen: delete this;

                            1 Reply Last reply
                            0
                            • Greg UtasG Greg Utas

                              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.

                              B Offline
                              B Offline
                              BryanFazekas
                              wrote on last edited by
                              #30

                              I don't print my code, but I've printed inherited code on 11x17 paper with narrow margins, as I had to physically diagram it to figure out what it was doing ... 9 sheets in portrait mode using Courier 9 point. In some cultures, a test of worthiness is going into battle. In IT? It's figuring out inherited code.

                              Greg UtasG 1 Reply Last reply
                              0
                              • M megaadam

                                It WAS Griff, and me! But methinks he was advocating Whitesmith's Indentation style - Wikipedia[^]

                                if(this->aintUgly())
                                {
                                thenWhatIs(); // ??
                                }

                                "If we don't change direction, we'll end up where we're going"

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

                                Ugh, workable but I don't like it :D

                                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

                                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

                                  A Offline
                                  A Offline
                                  agolddog
                                  wrote on last edited by
                                  #32

                                  Shouldn't this be our default position?

                                  1 Reply Last reply
                                  0
                                  • B BryanFazekas

                                    I don't print my code, but I've printed inherited code on 11x17 paper with narrow margins, as I had to physically diagram it to figure out what it was doing ... 9 sheets in portrait mode using Courier 9 point. In some cultures, a test of worthiness is going into battle. In IT? It's figuring out inherited code.

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

                                    Quote:

                                    I had to physically diagram it to figure out what it was doing

                                    What happened to the original author?! That should have been job security! If I inherited that code, I'd have him renditioned and put under bright lights until that code got explained. :-D

                                    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
                                    • 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.

                                      D Offline
                                      D Offline
                                      davecasdf
                                      wrote on last edited by
                                      #34

                                      My _132 column_ fanfold printout ( don'tcha miss the green stripes? ) plenty of room for comments after column 80. But I don't miss being near the chain printer.

                                      1 Reply Last reply
                                      0
                                      • J Jorgen Andersson

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

                                        Wrong is evil and must be defeated. - Jeff Ello

                                        D Offline
                                        D Offline
                                        davecasdf
                                        wrote on last edited by
                                        #35

                                        Almanak with soft pages.

                                        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

                                          K Offline
                                          K Offline
                                          Kirk 10389821
                                          wrote on last edited by
                                          #36

                                          OMG, I had to lookup Allman style to confirm... My argument was ALWAYS that we line these things up so they can be matched properly. And I believe the blank space adds context. void main / if / while -> all have the same simple formatting { // Yes this is good } and doubly hated the dual indentation: if () { // then this } REALLY hated: if () { // Same level, Uggh } So, welcome aboard. it just seems more consistent, and since I do a TON of Pascal/Delphi and PL/SQL, etc, etc. Where I would strangle someone for: if () BEGIN // OMG END

                                          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