Thread: C++ Coding Standard

  1. #1
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916

    C++ Coding Standard

    I just found this page, and thought that it was fairly interesting reading, so I decided that I would pass the link along to all y'all. I'm not sure if it is the official standard or not, but it looks good to me. (didn't read it all)

    http://www.possibility.com/Cpp/CppCodingStandard.html
    Away.

  2. #2
    Registered User Xei's Avatar
    Join Date
    May 2002
    Posts
    719
    That is quite long, and even though it may cover much of the standards I do not believe that it is legitimate. I just think that a standard would be much more specific, and professional, than just saying
    int
    some_bloody_function()
    {
    }
    "What are you after - the vague post of the week award?" - Salem
    IPv6 Ready.
    Travel the world, meet interesting people...kill them.
    Trying to fix or change something, only guaruntees and perpetuates its existence.
    I don't know about angels, but it is fear that gives men wings.
    The problem with wanting something is the fear of losing it, or never having it. The thought makes you weak.

    E-Mail Xei

  3. #3
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    I doubt the ANSI C++ committee would endorse an 'official' set of coding standards.

    It does look good and rather thorough, though it is a bit excrutiatingly long.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  4. #4
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    i like the "Flow Chart for Project Decision Making"

    good stuff


    http://www.possibility.com/Cpp/CppCo...dard.html#flow

  5. #5
    booyakasha
    Join Date
    Nov 2002
    Posts
    208
    Coding standards are usually set by the company you work for.

    If you don't work for a company, choose the standards which you think are best and stick to them.

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >If you don't work for a company, choose the standards which you think are best and stick to them.
    And keep an open mind. Be prepared to change your mind and use another style if your tastes change or you find a strong argument against what you use. Case in point: As many people here probably know, my style has been very unique (to my knowledge):
    Code:
    #include <stdio.h>
    
    /*
    ** K&R bracing,
    ** Lots of whitespace between tokens,
    ** Two space indention
    */
    int main ( void )
    {
      int i;
    
      for ( i = 0; i < 10; i++ ) {
        printf ( "%d\n", i );
      }
    
      return 0;
    }
    Recently though, I've begun to fall into a more common style and found it to be more pleasing as well as easier to write:
    Code:
    #include <stdio.h>
    
    /*
    ** Allman bracing,
    ** Less whitespace between tokens,
    ** Four space indention
    */
    int main(void)
    {
        int i;
    
        for (i = 0; i < 10; i++)
        {
            printf("%d\n", i);
        }
    
        return 0;
    }
    My best code is written with the delete key.

  7. #7
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > or you find a strong argument against what you use.
    I do not argue against your new change, in fact, that is what I use despite the fact that I am no where near as knowledgable as you. Seems less jumbled IMO.

    Oh, and welcome back Prelude.
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. array initialization & C standard
    By jim mcnamara in forum C Programming
    Replies: 2
    Last Post: 09-12-2008, 03:25 PM
  2. C++ Coding Standard Question/Discussion
    By Mastadex in forum C++ Programming
    Replies: 11
    Last Post: 08-13-2008, 10:54 AM
  3. Bug in iterator comparison in C++ standard?
    By steev in forum C++ Programming
    Replies: 14
    Last Post: 07-12-2008, 12:02 AM
  4. C/C++ standard
    By confuted in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 07-06-2003, 03:22 AM
  5. standard language, standard compiler?
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 09-03-2001, 04:21 AM