Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Understanding large C++ programs

Reply
Thread Tools

Understanding large C++ programs

 
 
sasquatch
Guest
Posts: n/a
 
      10-18-2006
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.

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      10-18-2006
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


 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      10-18-2006
"sasquatch" <> wrote in message
news: 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.


 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a
 
      10-18-2006

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.

 
Reply With Quote
 
=?ISO-8859-1?Q?Jens_M=FCller?=
Guest
Posts: n/a
 
      10-19-2006
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 ...
 
Reply With Quote
 
AnonMail2005@gmail.com
Guest
Posts: n/a
 
      10-19-2006

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.

 
Reply With Quote
 
sasquatch
Guest
Posts: n/a
 
      10-19-2006

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.

 
Reply With Quote
 
ralph
Guest
Posts: n/a
 
      10-19-2006
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

 
Reply With Quote
 
Nick Keighley
Guest
Posts: n/a
 
      10-19-2006
Jim Langston wrote:
> "sasquatch" <> wrote 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

 
Reply With Quote
 
chandrahasanstar01@gmail.com
Guest
Posts: n/a
 
      10-19-2006


On Oct 19, 1:46 am, "sasquatch" <ank...@gmail.com> 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.

if you find answer " Please tell to me "

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EDA, PCB, Mentor Graphics programs 2006 - , programs, ola8@mail.gr VHDL 0 05-31-2006 08:07 PM
retrieveing programs deleted in add or remove programs in control panel truebluedave Computer Support 2 08-23-2005 10:32 PM
Programs take a long time to launch from A.Programs Me MCSE 9 01-20-2005 04:05 PM
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C++ 12 01-10-2005 03:35 AM
Re: How to see all programs after Start -> All Programs Ben Leal Computer Support 1 08-06-2003 01:58 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57