home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19814 < prev    next >
Encoding:
Text File  |  1993-01-24  |  2.8 KB  |  66 lines

  1. Newsgroups: comp.lang.c++
  2. 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
  3. From: erc@netcom.com (Eric Smith)
  4. Subject: Re: C++ maintenance
  5. Message-ID: <1993Jan23.230414.26939@netcom.com>
  6. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  7. References: <C1BnAy.C3F@geovision.gvc.com>
  8. Distribution: na
  9. Date: Sat, 23 Jan 1993 23:04:14 GMT
  10. Lines: 54
  11.  
  12. In article <C1BnAy.C3F@geovision.gvc.com> djb@geovision.gvc.com (Darren Burns) writes:
  13. >
  14. >I recently had the pleasure (not) of trying to track down a bug in
  15. >some C++ code.  The author(s) of the code were not that experienced
  16. >in C++, but I don't think that matters here.
  17. >
  18. >I just wanted to get some comments about the following.  Suppose I'm
  19. >looking at a C++ program.  I have a pretty good understanding of what
  20. >it does, but I'm not terribly familiar with the code.  In a member
  21. >function I see:
  22. >
  23. >int the_class::do_something ( )
  24. >{
  25. >...
  26. >    foo->xxx();
  27. >...
  28. >}
  29. >
  30. >Now, I'm browsing through this code and I'm thinking maybe the bug I'm
  31. >looking for is in xxx().  I want to take a look at it.  In order to know
  32. >which xxx to look at (since there may be many classes that have xxx), I
  33. >need to know what class foo is.  But foo could be a global variable,
  34. >a member of the_class, or a variable local to the function.  I have to
  35. >hunt all over the place just to find out where to look for xxx.
  36. >
  37. >I find this a real pain.  I'm not experienced with C++, so maybe it's
  38. >something you get used to.  I think that it's a general problem with
  39. >OOP, although the syntax of the language can make it better or worse.
  40. >It seems that C++ is great if you know the program very well (i.e. if
  41. >you designed/wrote it), but is difficult to maintain.
  42. >
  43. >Are there others who find the same thing?  Is there some way of setting
  44. >things up to avoid this sort of problem?
  45. >
  46. >Thanks.
  47. >
  48. >(I never did find that bug, by the way :-))
  49. >
  50. >Darren Burns
  51.  
  52.  
  53. You need a browser which will let you click your mouse on foo and/or
  54. xxx rather than searching for it.  The browser will show a window with
  55. the class or function definition, and you can then click on something
  56. in that window to get another such window, etc.  For example, if you
  57. click on foo in your example above, you get a window showing the
  58. definition of foo, which will show you its class.  Suppose that class
  59. is fooclass, you then click on the word fooclass to get another window
  60. showing class fooclass.  Inside of class fooclass you might see a
  61. declaration of xxx, so you would click on xxx to get a window showing
  62. fooclass::xxx, and then you could look inside the function block of xxx
  63. in that window and click on other stuff the same way.  Or, instead of
  64. clicking on foo in the first place, you can click on xxx and get the
  65. fooclass::xxx window immediately.
  66.