sasquatch said:
X-No-Archive:
Are there any good books that provide tips about how to understand and
"play with" large C++ programs? It seems like a very important skill,
and yet its hardly taught in the universities. Basic programming skills
and knowledge of language constructs don't seem enough for
understanding larger programs.
Some large systems are easier to learn than others. It's not something that
easily taught, as sometimes even understanding a small program can be a pain
depending on how it's written.
Generally when I want to understand a program I will load it up in my
favorite editor and start putting it into a format I'm familiar with. This
does two things, it makes it easier for me to read, but it also makes me
familiar with the code. I will not save the editing I do, but it just helps
me becuase I have to go through the entire code. I don't know if others do
this. If, on the other hand, code is already in a format that's easy for me
to read then I'm happy.
One of the things I do there is change stupid variable names to ones that
make sense if they didn't do that. Oh, they used ii for number of steps,
let me change that to NumOfSteps with search and replace if I can, etc..
Usually by the time I"m done with that I understand the code. If not, then
I need to start looking at it closer.
Some programs are just a joy to read, withi good structured code with
logical variable names I find I can read it as easy as a book, if not
easier.
There was one program I was working on, however, modifying that even after 3
months of working on it I still didn't understand that code fully, it was so
horribly written (C code, not C++).
I really don't know what to tell you.