By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,122 Members | 1,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,122 IT Pros & Developers. It's quick & easy.

How to read large C++ code?

P: n/a
How to quickly read large C++ code with hundreds of classes, thousands
of lines?
Thanks.

Jack

Dec 30 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a

ju******@gmail.com wrote:
How to quickly read large C++ code with hundreds of classes, thousands
of lines?
You don't. You read pieces of it.

Dec 30 '06 #2

P: n/a
ju******@gmail.com wrote:
How to quickly read large C++ code with hundreds of classes, thousands
of lines?
Well, if by "read" you mean "understand" and it doesn't have any useful
documentation, running doxygen over it with everything switched on in the
Doxyfile generates a good overview to get a start.

Dec 30 '06 #3

P: n/a

Rolf Magnus wrote:
ju******@gmail.com wrote:
How to quickly read large C++ code with hundreds of classes, thousands
of lines?

Well, if by "read" you mean "understand" and it doesn't have any useful
documentation, running doxygen over it with everything switched on in the
Doxyfile generates a good overview to get a start.
Thanks. It seems to me that doxygen extracts the comments from the code
to generate a document about the code. But if the code is not well
commented, what will be generated by doxygen?
Certainly, I need not understand each line of the large C++ code. For
some parts of the C++ code, I need to understand each line. For the
rest, I need to understand the structure and logic of it. Generally,
what is the best way to do it?

Jack

Dec 31 '06 #4

P: n/a
ju******@gmail.com wrote:
>
Rolf Magnus wrote:
>ju******@gmail.com wrote:
How to quickly read large C++ code with hundreds of classes, thousands
of lines?

Well, if by "read" you mean "understand" and it doesn't have any useful
documentation, running doxygen over it with everything switched on in the
Doxyfile generates a good overview to get a start.

Thanks. It seems to me that doxygen extracts the comments from the code
to generate a document about the code. But if the code is not well
commented, what will be generated by doxygen?
I think by default nothing. But you can toggle a switch in the Doxyfile to
still generate the documentation. It gives you lists of classes an
namespaces, inheritance hierarchy, and for every class a list of its
members. It can generate call graphs, collaboration diagrams and more if
you also insall the graphviz package. There is still plenty of information
doxygen can get, even if the code doesn't have proper comments.
Certainly, I need not understand each line of the large C++ code. For
some parts of the C++ code, I need to understand each line.
Doxygen can also be configured to include the source code of a function in
its documentation.
For the
rest, I need to understand the structure and logic of it. Generally,
what is the best way to do it?
I still think doxygen is a good start in such a situation. Just give it a
try.
Dec 31 '06 #5

P: n/a

"Rolf Magnus" <ra******@t-online.dewrote in message
news:en*************@news.t-online.com...
ju******@gmail.com wrote:
>>
Rolf Magnus wrote:
>>ju******@gmail.com wrote:

How to quickly read large C++ code with hundreds of classes, thousands
of lines?

Well, if by "read" you mean "understand" and it doesn't have any useful
documentation, running doxygen over it with everything switched on in
the
Doxyfile generates a good overview to get a start.

Thanks. It seems to me that doxygen extracts the comments from the code
to generate a document about the code. But if the code is not well
commented, what will be generated by doxygen?

I think by default nothing. But you can toggle a switch in the Doxyfile to
still generate the documentation. It gives you lists of classes an
namespaces, inheritance hierarchy, and for every class a list of its
members. It can generate call graphs, collaboration diagrams and more if
you also insall the graphviz package. There is still plenty of information
doxygen can get, even if the code doesn't have proper comments.
>Certainly, I need not understand each line of the large C++ code. For
some parts of the C++ code, I need to understand each line.

Doxygen can also be configured to include the source code of a function in
its documentation.
>For the
rest, I need to understand the structure and logic of it. Generally,
what is the best way to do it?

I still think doxygen is a good start in such a situation. Just give it a
try.
I agree. it's a fine tool to use with GraphViz installed to get all the
pretty
graphs. Of course the best part is that it's free.

Tony
Dec 31 '06 #6

P: n/a

Rolf Magnus wrote:
ju******@gmail.com wrote:

Rolf Magnus wrote:
ju******@gmail.com wrote:

How to quickly read large C++ code with hundreds of classes, thousands
of lines?

Well, if by "read" you mean "understand" and it doesn't have any useful
documentation, running doxygen over it with everything switched on in the
Doxyfile generates a good overview to get a start.
Thanks. It seems to me that doxygen extracts the comments from the code
to generate a document about the code. But if the code is not well
commented, what will be generated by doxygen?

I think by default nothing. But you can toggle a switch in the Doxyfile to
still generate the documentation. It gives you lists of classes an
namespaces, inheritance hierarchy, and for every class a list of its
members. It can generate call graphs, collaboration diagrams and more if
you also insall the graphviz package. There is still plenty of information
doxygen can get, even if the code doesn't have proper comments.
Certainly, I need not understand each line of the large C++ code. For
some parts of the C++ code, I need to understand each line.

Doxygen can also be configured to include the source code of a function in
its documentation.
For the
rest, I need to understand the structure and logic of it. Generally,
what is the best way to do it?

I still think doxygen is a good start in such a situation. Just give it a
try.
Thanks a lot. I will try it.
By the way, is there any commercial software that can do the same
thing?

Jack

Dec 31 '06 #7

P: n/a
ju******@gmail.com writes:
How to quickly read large C++ code with hundreds of classes, thousands
of lines?
Use a debugger and step thru it. This helps me, to understand foreign
code. Draw UML diagrams beside. Use your own abstraction capability
to concentrate on the essentials.

Cheers,
Rudiger

--
The next sentence is right
The previous sentence is wrong.
Jan 2 '07 #8

P: n/a
On 31 Dec 2006 15:49:24 -0800, ju******@gmail.com wrote:
>Rolf Magnus wrote:
>I still think doxygen is a good start in such a situation. Just give it a
try.

Thanks a lot. I will try it.
By the way, is there any commercial software that can do the same
thing?
http://www.scitools.com/

Jan 2 '07 #9

P: n/a
How to quickly read large C++ code with hundreds of classes, thousands
of lines?
Tools "understand C++" and "Source insigt" were useful for me.
Try these. They have evaluation period of 15 days and 30 days.

Jan 3 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.