On Mon, 28 Aug 2006 21:04:14 UTC, "bim_bom" <ju******@go2.plwrote:
I have a projet in C++ Builder.
I want to add aome lines of comment before each function of the project.
This should work like that:
I have function:
int r(int a,char b)
{
}
this program should generate a comment before this function like that:
/**
function name - r -
parameter a -
parameter b -
returns int -
*/
or something like that.
I found CommentMakerPro, but it can't do "batch conversions" - I nedd to
select each function/method and then click to generate comments. Is there
any program to do this automatically?
Is there something wrong with "the human touch"? A simple copy and paste
operation will give you the prototype documentation. The important
details are the parameters, return values, and comments about the
methods. Humans are best at that.
In my opinion, most of these types of comments are useless to begin with
as they state the obvious. I'd rather see useful names and comments
about what is expected, returned, and a good description of the
operations involved.
Inline comments (those on bracket levels and where needed to explain
the code) are generally more useful than function headers.
I'd advise you to document and rework some or all of the code as you
visit each moduule or section of code. It takes a little longer at
first, but you can easily reformat and document hundreds or thousands
of lines per day. The added benefit is that you actually visited the
code and read what it is doing. You get to find problems and learn
what is in your code base.
The only true shortcut to making your code easy to use is to design
it that way. Tools may add a little fluff or reformat the code to
be easier to read, but unless you understand what it is that you
have, it is still just a mystery and you are doomed to wandering
around to find what you need or reinventing each solution as you
need it.
David