473,511 Members | 15,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Understanding large C++ programs

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.

Oct 18 '06 #1
10 2670
sasquatch wrote:
Are there any good books that provide tips about how to understand and
"play with" large C++ programs?
Actually, it doesn't matter in what language those programs are written.
Understanding large systems requires a different approach than writing
code. That's why in most cases it's a "software engineering" problem
and not a "programming" one.
It seems like a very important skill,
Yes. And it's not a simple skill to teach. Knowing how to lay
bricks isn't enough to build a house. However, you can learn to
build houses without ever learning to lay bricks.
and yet its hardly taught in the universities.
I'll take your word for it.
Basic programming
skills and knowledge of language constructs don't seem enough for
understanding larger programs.
They aren't.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 18 '06 #2
"sasquatch" <an****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
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.
Oct 18 '06 #3

sasquatch wrote:
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.
There is no real way to understand larger programs. The problem is too
large for most human brains. You can understand the big picture if the
design is good. You can understand particular parts very well and how
they plug into the bigger design. Sometimes you know different parts
than you do at other times. I can only wrap my head around a few
thousand lines of code at once. This is why I use reminders
(descriptive names and small functions) and constructs that are not
easily used incorrectly.

The real issue is being able to follow and decipher localized areas of
code and create an understanding of the area you are working on. Some
designs are easier than others in this regard; for instance, small
functions are always easier to understand than long ones. One trick is
to do what is called a scratch refactor...that is, go into the code and
do some cleaning wherever you see a need, when you are done you throw
it away and start over with a clearer idea of what is needed. It is
described better in Working Effectively with Legacy Code by Michael
Feathers...or you can google it.

Speaking of google, some good keywords are "refactoring" and "design
patterns".

Most Universities teach you next to nothing that you need in the
workforce. This type of thing is only recieved through experience.
There are plenty of OS projects you can play with, some are VERY large.
You can always download the source and try to understand it even if
they don't let you submit changes.

Oct 18 '06 #4
sasquatch schrieb:
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.
Your university does not teach software engineering? Bad one ...
Oct 19 '06 #5

sasquatch wrote:
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.
Try "Large-Scale C++ Software Design", by John Lakos.

Oct 19 '06 #6

Jens Müller wrote:
sasquatch schrieb:
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.

Your university does not teach software engineering? Bad one ...
There is a difference between building software and understanding
legacy systems. The first is taught in software engineering classes,
the latter is not.

Oct 19 '06 #7
sasquatch schrieb:
X-No-Archive:

Are there any good books that provide tips about how to understand and
"play with" large C++ programs?
Spinellis: Code Reading

hth
ralpe

Oct 19 '06 #8
Jim Langston wrote:
"sasquatch" <an****@gmail.comwrote in message
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.
<snip>
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.
this becomes impractical when kloc 200 or so

<snip>

--
Nick Keighley

Oct 19 '06 #9


On Oct 19, 1:46 am, "sasquatch" <ank...@gmail.comwrote:
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.
if you find answer " Please tell to me "

Oct 19 '06 #10
sasquatch wrote:
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.
I don't suggest understanding large programs.
Many large programs are too large for any one person to
comprehend and remember. In my years of experience,
large programs are divided into sections. Most people
working on the large programs have a general concept
of the sections, but detailed knowledge about a few.

Large programs are out of control. Large groups are
difficult to control.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
Oct 20 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
3382
by: assaf__ | last post by:
Hello, I am beginning to work on a fairly large project and I'm considering to use python for most of the coding, but I need to make sure first that it is reliable enough. I need to make sure...
36
6323
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
1
2583
by: Adriaan Renting | last post by:
I think the point you want to make is that Python needs vastly less lines of code as a similar application written in C++. I think Python might on average be 50-60% of comparable C++ code, but not...
55
5105
by: Jonas Smithson | last post by:
I've seen a few attractive multi-column sites whose geometry is based on pure CSS-P, but they're what you might call "code afficionado" sites, where the subject matter of the site is "coding...
6
3232
by: Tom | last post by:
We have a VERY simple .NET C# Form Application, that has about a 23MB Memory Footprint. It starts a window runs a process and does a regular expression. I have done a GC.Collect to make sure that,...
24
4004
by: Salad | last post by:
Every now and then I see ads that state something like "Experience with Large Databases ...multi-gig...blah-de-blah" And I have to laugh. What's the difference between a large or small database? ...
18
2178
by: Simon | last post by:
Hi, I understand what one the differences between std::vector, std::deque and std::list is, the std::vector can have data inserted/deleted at the end. The std::deque can have data...
2
1172
by: Jonathan Wood | last post by:
I'm looking into implementing Web services to provide product activation codes to resellers. This seems to be going fine. One large reseller tells me they support CGI for this purpose, as thought...
36
2509
by: sh.vipin | last post by:
how to make large macro paste the code as it is Problem Explanation '-- For example in the program below /* a.c - starts here */ #define DECL_VARS() \ unsigned int a0;\ unsigned int a1;\...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
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,...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.