C++ coding standards

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dom.k.black@googlemail.com

    C++ coding standards

    Can anyone recommend a good existing C++ coding standard - parctical,
    pragmatic and sensible?

    A company I joined recently are moving from C to C++, they are very
    much into coding standards. But I have a horibble feeling they might
    get a C programmer to write the C++ standard. Would be nice to be able
    to suggest an existing standard.
  • dave_mikesell@fastmail.fm

    #2
    Re: C++ coding standards

    On Mar 21, 7:55 am, dom.k.bl...@goo glemail.com wrote:
    Can anyone recommend a good existing C++ coding standard - parctical,
    pragmatic and sensible?
    >
    A company I joined recently are moving from C to C++, they are very
    much into coding standards. But I have a horibble feeling they might
    get a C programmer to write the C++ standard. Would be nice to be able
    to suggest an existing standard.
    No, but just a bit of advice to keep the "style" section to a
    minimum. You can download and integrate a source code formatter (like
    SourceFormatX) into your build stream that will format the code
    according to your preference. Concentrate more on best practices. I
    don't care what the name of the function is or where you put the curly
    brace if it returns a dangling pointer.

    Comment

    • Maarten Kronenburg

      #3
      Re: C++ coding standards


      wrote in message
      Can anyone recommend a good existing C++ coding standard - parctical,
      pragmatic and sensible?
      >
      A company I joined recently are moving from C to C++, they are very
      much into coding standards. But I have a horibble feeling they might
      get a C programmer to write the C++ standard. Would be nice to be able
      to suggest an existing standard.
      There is the book "C++ Coding Standards" by Sutter and Alexandrescu.


      Comment

      • dom.k.black@googlemail.com

        #4
        Re: C++ coding standards

        On Mar 21, 3:03 pm, "Maarten Kronenburg" <M.Kronenb...@i nter.nl.net>
        wrote:
        wrote in message
        Can anyone recommend a good existing C++ coding standard - parctical,
        pragmatic and sensible?
        >
        A company I joined recently are moving from C to C++, they are very
        much into coding standards. But I have a horibble feeling they might
        get a C programmer to write the C++ standard. Would be nice to be able
        to suggest an existing standard.
        >
        There is the book "C++ Coding Standards" by Sutter and Alexandrescu.
        There was another book I heard of, 101 tips or something similar.

        Are these worth investing in?

        Comment

        • ciccio

          #5
          Re: C++ coding standards

          dom.k.black@goo glemail.com wrote:
          Can anyone recommend a good existing C++ coding standard - parctical,
          pragmatic and sensible?
          >
          A company I joined recently are moving from C to C++, they are very
          much into coding standards. But I have a horibble feeling they might
          get a C programmer to write the C++ standard. Would be nice to be able
          to suggest an existing standard.
          Hi,

          Have a look at this chapter in the faq-lite.


          Comment

          • Yannick Tremblay

            #6
            Re: C++ coding standards

            In article <f6925509-cb4c-4b6f-af96-33fc697a45d1@i1 2g2000prf.googl egroups.com>,
            <dom.k.black@go oglemail.comwro te:
            >On Mar 21, 3:03 pm, "Maarten Kronenburg" <M.Kronenb...@i nter.nl.net>
            >wrote:
            > wrote in message
            Can anyone recommend a good existing C++ coding standard - parctical,
            pragmatic and sensible?
            >>
            A company I joined recently are moving from C to C++, they are very
            much into coding standards. But I have a horibble feeling they might
            get a C programmer to write the C++ standard. Would be nice to be able
            to suggest an existing standard.
            >>
            >There is the book "C++ Coding Standards" by Sutter and Alexandrescu.
            >
            >There was another book I heard of, 101 tips or something similar.
            >
            >Are these worth investing in?
            IMO, you could do a lot worse than buying a copy of this
            book. (Actually the company should buy the copy of the book for the
            pricely sum of about 1 hours of developper time), read through it,
            select the ones you agree with (hopefully most), delete the ones you
            disagree, maybe ignore the ones that are irrelevant to your situation,
            and publish your own standard built upon this solid base
            adding your own favourite one for local flavour and placing the book
            in the public company bookshelf for reference and longer explaination
            of some guidelines.

            Yan

            Comment

            • Ian Collins

              #7
              Re: C++ coding standards

              dom.k.black@goo glemail.com wrote:
              Can anyone recommend a good existing C++ coding standard - parctical,
              pragmatic and sensible?
              >
              A company I joined recently are moving from C to C++, they are very
              much into coding standards. But I have a horibble feeling they might
              get a C programmer to write the C++ standard. Would be nice to be able
              to suggest an existing standard.
              The whole team should devise the coding standard.

              I wrote one for my last company, but we dumped it in favour of what
              ended up as a best practice page on our team wiki. Too many coding
              standards go into way too much detail, with section on indentation,
              brace placement and other trivia. Let the team decide as they share
              code what works for them, if you have rules, make them editor or pretty
              print ones that can be kept up to date.

              --
              Ian Collins.

              Comment

              • 322322

                #8
                Re: C++ coding standards

                On 3ÔÂ26ÈÕ, ÏÂÎç12ʱ28·Ö, Ian Collins <ian-n...@hotmail.co mwrote:
                dom.k.bl...@goo glemail.com wrote:
                Can anyone recommend a good existing C++ coding standard - parctical,
                pragmatic and sensible?
                >
                A company I joined recently are moving from C to C++, they are very
                much into coding standards. But I have a horibble feeling they might
                get a C programmer to write the C++ standard. Would be nice to be able
                to suggest an existing standard.
                >
                The whole team should devise the coding standard.
                >
                I wrote one for my last company, but we dumped it in favour of what
                ended up as a best practice page on our team wiki. Too many coding
                standards go into way too much detail, with section on indentation,
                brace placement and other trivia. Let the team decide as they share
                code what works for them, if you have rules, make them editor or pretty
                print ones that can be kept up to date.
                >
                --
                Ian Collins.
                The c++ Programming Languange

                Comment

                • Ian Collins

                  #9
                  Re: C++ coding standards

                  322322 wrote:
                  On 3ÔÂ26ÈÕ, ÏÂÎç12ʱ28·Ö, Ian Collins <ian-n...@hotmail.co mwrote:
                  >dom.k.bl...@go oglemail.com wrote:
                  >>Can anyone recommend a good existing C++ coding standard - parctical,
                  >>pragmatic and sensible?
                  >>A company I joined recently are moving from C to C++, they are very
                  >>much into coding standards. But I have a horibble feeling they might
                  >>get a C programmer to write the C++ standard. Would be nice to be able
                  >>to suggest an existing standard.
                  >The whole team should devise the coding standard.
                  >>
                  >I wrote one for my last company, but we dumped it in favour of what
                  >ended up as a best practice page on our team wiki. Too many coding
                  >standards go into way too much detail, with section on indentation,
                  >brace placement and other trivia. Let the team decide as they share
                  >code what works for them, if you have rules, make them editor or pretty
                  >print ones that can be kept up to date.
                  >>
                  >
                  The c++ Programming Languange
                  Is that a random utterance, or a comment?

                  --
                  Ian Collins.

                  Comment

                  • Default User

                    #10
                    Re: C++ coding standards

                    Ian Collins wrote:
                    dom.k.black@goo glemail.com wrote:
                    Can anyone recommend a good existing C++ coding standard -
                    parctical, pragmatic and sensible?

                    A company I joined recently are moving from C to C++, they are very
                    much into coding standards. But I have a horibble feeling they might
                    get a C programmer to write the C++ standard. Would be nice to be
                    able to suggest an existing standard.
                    >
                    The whole team should devise the coding standard.
                    >
                    I wrote one for my last company, but we dumped it in favour of what
                    ended up as a best practice page on our team wiki.
                    Here, we had a group of representatives from the major projects using
                    C++ (inaptly named "The C++ Users Group) to work on the coding standard.
                    Too many coding
                    standards go into way too much detail, with section on indentation,
                    brace placement and other trivia. Let the team decide as they share
                    code what works for them, if you have rules, make them editor or
                    pretty print ones that can be kept up to date.
                    I strongly disagree with this. It's best to bite the bullet on those
                    things upfront, or it's a continual battle all through the project.




                    Brian

                    Comment

                    Working...