Thread: Code style/formatting/organizing

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    30

    Code style/formatting/organizing

    What guidelines do you guys follow for structuring and formatting your C++ code in general? Have you guys spent a lot of time looking at other people's code and attempting to mimic their style? What sources would you all recommend for finding other code out there on the web specifically for the purposes of finding organized, coherent, well-structured, well-formatted code examples, (so that you can follow their coding style and organization)?

    For the purposes of this discussion, I am referring specifically to how you comment code, how you space your code out using whitespace, how you structure your whole source code so that your functions and your variables are very organized, etc. I guess all of this falls into the category of code organization and style best practices.

    One source I found, Learn C++, has some good information about this topic. Do any of you have an opinion of the guidelines posted on that site that pertain to this topic? What other sites would you recommend?

  2. #2
    ...and never returned. StainedBlue's Avatar
    Join Date
    Aug 2009
    Posts
    168
    Guideline:

    make it readable
    goto( comeFrom() );

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Quote Originally Posted by StainedBlue View Post
    Guideline:

    make it readable
    More specifically: Adopt one of many styles out there or make up your own, but in a project never change it!
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM