home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cs.utexas.edu!torn!nott!uotcsi2!revcan!geovision!djb
- From: djb@geovision.gvc.com (Darren Burns)
- Subject: C++ maintenance
- Message-ID: <C1BnAy.C3F@geovision.gvc.com>
- Organization: Not officially GeoVision Systems Inc., Ottawa, Ontario, Canada
- Distribution: na
- Date: Sat, 23 Jan 1993 19:25:44 GMT
- Lines: 38
-
-
- I recently had the pleasure (not) of trying to track down a bug in
- some C++ code. The author(s) of the code were not that experienced
- in C++, but I don't think that matters here.
-
- I just wanted to get some comments about the following. Suppose I'm
- looking at a C++ program. I have a pretty good understanding of what
- it does, but I'm not terribly familiar with the code. In a member
- function I see:
-
- int the_class::do_something ( )
- {
- ...
- foo->xxx();
- ...
- }
-
- Now, I'm browsing through this code and I'm thinking maybe the bug I'm
- looking for is in xxx(). I want to take a look at it. In order to know
- which xxx to look at (since there may be many classes that have xxx), I
- need to know what class foo is. But foo could be a global variable,
- a member of the_class, or a variable local to the function. I have to
- hunt all over the place just to find out where to look for xxx.
-
- I find this a real pain. I'm not experienced with C++, so maybe it's
- something you get used to. I think that it's a general problem with
- OOP, although the syntax of the language can make it better or worse.
- It seems that C++ is great if you know the program very well (i.e. if
- you designed/wrote it), but is difficult to maintain.
-
- Are there others who find the same thing? Is there some way of setting
- things up to avoid this sort of problem?
-
- Thanks.
-
- (I never did find that bug, by the way :-))
-
- Darren Burns
-