home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!elroy.jpl.nasa.gov!swrinde!emory!gatech!destroyer!fmsrl7!lynx.unm.edu!umn.edu!csus.edu!netcom.com!erc
- From: erc@netcom.com (Eric Smith)
- Subject: Re: C++ maintenance
- Message-ID: <1993Jan23.230414.26939@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <C1BnAy.C3F@geovision.gvc.com>
- Distribution: na
- Date: Sat, 23 Jan 1993 23:04:14 GMT
- Lines: 54
-
- In article <C1BnAy.C3F@geovision.gvc.com> djb@geovision.gvc.com (Darren Burns) writes:
- >
- >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
-
-
- You need a browser which will let you click your mouse on foo and/or
- xxx rather than searching for it. The browser will show a window with
- the class or function definition, and you can then click on something
- in that window to get another such window, etc. For example, if you
- click on foo in your example above, you get a window showing the
- definition of foo, which will show you its class. Suppose that class
- is fooclass, you then click on the word fooclass to get another window
- showing class fooclass. Inside of class fooclass you might see a
- declaration of xxx, so you would click on xxx to get a window showing
- fooclass::xxx, and then you could look inside the function block of xxx
- in that window and click on other stuff the same way. Or, instead of
- clicking on foo in the first place, you can click on xxx and get the
- fooclass::xxx window immediately.
-