Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3757236
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:58:29+00:00 2026-05-19T09:58:29+00:00

Firstly, I am aware of this question: Are there standard formats for comments within

  • 0

Firstly, I am aware of this question:
Are there standard formats for comments within code?

But it didn’t answer mine. Whenever I write code, I always try to form a habit of ensuring that the comments are all consistent, but that is where I am sometimes indecisive about my code format convention. Especially since I want my code to be 80 or so lines wide.

Needless to say, a code format convention should be:

  • Easy to read
  • Easy to modify

And there may be different comment formats in different parts of your code, so it’s important to ensure they remain consistent and readable.

Here are some examples:

Single Line

// simple comment in lowercase
do_something();

// longer comment in lowercase. but now it doesn't seem like a proper sentence.
do_something();

// Longer comment in sentence case. But should we use sentence case for short comments too?
do_something();
// Like this one?
do_something_else(); // Or even this one.

Multi-line

// This code is very detailed and so I must continue further.
// Every time you start a new line you need to ensure you add //.
// If you finish your comment and forget to add something, you're screwed.
// You'll have to add your something and then make sure all the lines are 80 characters or less,
// and if they aren't you need to restructure all the lines below it.

/*  This is better but you need to make sure it's properly indented each line.
    Although you have to worry about those comment delimiters getting in the way. 
    At least it's compact. */

/*  This comment seems better.
    No need to worry about that last delimiter being inside your comment block.
*/

/*  
    Or maybe this is better?
    At least it looks clean.
*/

/*  GOOD FOR FUNCTION DEFINITIONS
    Or maybe this is even better?
    Who knows?
*/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:58:30+00:00Added an answer on May 19, 2026 at 9:58 am

    Answer 1 – don’t, any time wasted argueing about braces is a waste of time.

    Answer 2 – if you must, just pick one eg. http://www.possibility.com/Cpp/CppCodingStandard.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, please don't dismiss this question - I'm aware it's an ugly situation but
Firstly, I'm aware of this question , but I don't believe I'm asking the
Firstly sorry if this is a common question but I couldn't find anything on
Firstly I am aware of this question: XSLT: Loop selecting two elements at a
Firstly, very sorry if this is not a true stackoverflow question. But it's something
Firstly, I know this [type of] question is frequently asked, so let me preface
Firstly, this is going to sound like homework, but it ain't. Just a problem
Firslty, I'm aware of some similar questions along the lines of this one, but
Firstly I realise that this is a familiar question, it seems to pop up
Firstly, this is for a class so there are limitations on what we can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.