473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to read large C++ code?

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

Jack

Dec 30 '06 #1
9 4077

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
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

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
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

"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

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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: SimonC | last post by:
I've done a couple of hours web-searching without turning up many answers so far, and I guess I could figure it out (eventually) from the MIME format, but here goes with my question... I don't...
11
by: Sebastian Krause | last post by:
Hello, I tried to read in some large ascii files (200MB-2GB) in Python using scipy.io.read_array, but it did not work as I expected. The whole idea was to find a fast Python routine to read in...
75
by: Greg McIntyre | last post by:
I have a Python snippet: f = open("blah.txt", "r") while True: c = f.read(1) if c == '': break # EOF # ... work on c Is some way to make this code more compact and simple? It's a bit...
4
by: kj | last post by:
I consider myself quite proficient in C and a few other programming languages, but I have never succeeded in understanding a largish program (such as zsh or ncurses) at the source level. ...
6
by: Rolf Schroedter | last post by:
(Sorry for cross-posting). I need to access large files > 2GByte (Linux, WinXP/NTFS) using the standard C-library calls. Till today I thought I know how to do it, namely for Win32: Use open(),...
9
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
2
by: ShawnD | last post by:
I'm having some issues when trying to read input off of a pipe using a python script. I'm trying to process packet data from tcpdump in real-time, so it's a filter that needs to read data while the...
6
by: comp.lang.php | last post by:
if (!function_exists('bigfile')) { /** * Works like file() in PHP except that it will work more efficiently with very large files * * @access public * @param mixed $fullFilePath * @return...
2
by: Kevin Ar18 | last post by:
I posted this on the forum, but nobody seems to know the solution: http://python-forum.org/py/viewtopic.php?t=5230 I have a zip file that is several GB in size, and one of the files inside of it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.