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

Braces

Scheduled Pinned Locked Moved The Lounge
question
23 Posts 13 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.
  • Greg UtasG Greg Utas

    That's probably how K&R started, so people then thought it was the right way to do it.

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

    R Offline
    R Offline
    Rusty Bullet
    wrote on last edited by
    #21

    Agreed.

    1 Reply Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      No, not orthodonture. Has anyone else noticed that Microsoft has reformatted all of their online documentation to use K&R style braces instead of Allman style? I personally prefer the previous (Allman) style.

      The difficult we do right away... ...the impossible takes slightly longer.

      B Offline
      B Offline
      Bruce Patin
      wrote on last edited by
      #22

      I always preferred K&R when I worked on small screens, because I could see more code at once. now that I have huge screens, I like Allman better, because the braces line up. The guy with the fashionable little laptop must have won the battle.

      1 Reply Last reply
      0
      • L Lost User

        Well, I think it's important to remember that coding styles are personal preferences and opinions. Although I also prefer the BSD style I must admit.... being exposed to several styles increases my code comprehension levels. Here is a very old survey from the 7th of May 2012 with my comments on the subject. Do you have a coding style?[^] Best Wishes, -David Delaune

        M Offline
        M Offline
        Member_14884492
        wrote on last edited by
        #23

        Totally correct. There is the Allman style and everything else. I am so retentive about this, I surround single line indented lines like this. if (foo) { single_line(); } Sometimes real world function get longer than will fit on one or even two screens. Being able to clearly see and understand the organization of a complicated bit of logic makes it more likely the code is doing what you actually wanted it to do. And don't get me started on Hungarian notation. I guess if you are coding on paper or a chalkboard it makes sense. Otherwise, what a ridiculous concept.

        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