Thread: C++ commenting and C#'s

  1. #1
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497

    C++ commenting and C#'s

    Hello all ,
    i've been recently coding a project where it got huge suddenly .
    and i thought it would be a great idea that c++ ( or Visual Studio if thats IDE related ) has some commenting facilities that aids programmers have a better documented source code , just like C# .
    i'm specifically talking about those handy documentation facilities that C# offers.like the following example. where whenever we hover over the method or property we get a great description about that method or property's usage .
    Code:
    /// <summary>
    /// Constructor ,blah blah blah
    /// </summary>
            public Form1()
            {
                InitializeComponent();
            }
    do we have sth like this in C++? ( or in Microsoft Visual C++, im not sure if its a language related feature or an IDE related feature.)

    and if not what do you do to have sth like what we have in C#?
    again i mean how do you document your big projects in C++?
    Thank you in advance
    Last edited by Masterx; 07-03-2010 at 11:58 AM.
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There is no such way because it's not standard. The C++ standard allows for no documentation.
    That said, there are external utilities such as Doxygen that will do what you want.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I always use Doxygen comments.

    BTW, what's 'sth'?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  4. #4
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Quote Originally Posted by cpjust View Post
    I always use Doxygen comments.

    BTW, what's 'sth'?
    Thank you guys .
    but its not what i want, i want a tool which helps me in coding , i mean just like c#, when im going to use a method when hovering over it , i wan to see its description poped up, it would ease our lives significantly .
    this kinds of tools(doxygen) are great for documenting code sections before you dive in and start coding, but when you are coding , you cant remember all of those descriptions and stuff, so in coding they are useless to me .
    any idea in this specific manner?

    and by the way sth stands for 'some thing' .
    Last edited by Masterx; 07-03-2010 at 09:55 PM.
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Oh? But Visual Studio supports such things.
    Visual Studio 2010 also supports live compilation for C++. Isn't this what you're after? It's been supported for years.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    The Autodidact Dante Wingates's Avatar
    Join Date
    Apr 2010
    Location
    Valhalla
    Posts
    56
    Quote Originally Posted by Masterx View Post
    Thank you guys .
    but its not what i want, i want a tool which helps me in coding , i mean just like c#, when im going to use a method when hovering over it , i wan to see its description poped up, it would ease our lives significantly .
    What kind of question is that??? "I cant code for myself so I need something to aid me"? Do you want a tool which helps you in coding? IDEs serve this purpose. Do you want to know what every function does? RTFM... Are you really that lazy? Work with pseudo languages like java, vb or C#.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Or how about you just stick to your old editor and compiler and let us others stick with an IDE that saves us time by showing compile errors on-the-fly and shows us the arguments of a function, saving us a trip to the documentation, or even better, shows us the contents of a macro, or the type of a typedef, in case we forgot.
    This has nothing to do with what language it is. These are tools that should be/are available in all languages.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Especially for huge libraries you will want to have a description right away for each method. You will probably look on the documentation as well for more details, but what is what is always the first step.

  9. #9
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Quote Originally Posted by Elysia View Post
    Oh? But Visual Studio supports such things.
    Visual Studio 2010 also supports live compilation for C++. Isn't this what you're after? It's been supported for years.
    i noticed that and that's a great help to me . its fine but no its not what im looking for ,
    what i am asking is , why shouldn't classes encapsulate the description of methods and etc inside them there could be a metadata section which would serve this purpose or if not practical this can be achieved by a placing a metadata file which has those description next to our class, so while coding they help us and in compile time those metadata would not be present(they are treated like comments ).
    i really cant get it why we force ourselves to live primitive ! why not utilizing sth new which is presented in another language or IDE for our own ?

    Quote Originally Posted by Dante Wingates View Post
    What kind of question is that??? "I cant code for myself so I need something to aid me"? Do you want a tool which helps you in coding? IDEs serve this purpose. Do you want to know what every function does? RTFM... Are you really that lazy? Work with pseudo languages like java, vb or C#.
    read above
    Quote Originally Posted by Elysia View Post
    Or how about you just stick to your old editor and compiler and let us others stick with an IDE that saves us time by showing compile errors on-the-fly and shows us the arguments of a function, saving us a trip to the documentation, or even better, shows us the contents of a macro, or the type of a typedef, in case we forgot.
    This has nothing to do with what language it is. These are tools that should be/are available in all languages.
    i agree.
    Quote Originally Posted by C_ntua View Post
    Especially for huge libraries you will want to have a description right away for each method. You will probably look on the documentation as well for more details, but what is what is always the first step.
    yes but what did you mean by
    what is what is always the first step
    so all the things said, i came to the conclusion that , the feature im saying can be implemented by Visual Studio, descriptions can be entered in form of comments and they can reside in a file next to the class and help coding alot more enjoyable .
    Thank you for your time .
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


Popular pages Recent additions subscribe to a feed