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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!torn!nott!uotcsi2!revcan!geovision!djb
  3. From: djb@geovision.gvc.com (Darren Burns)
  4. Subject: C++ maintenance
  5. Message-ID: <C1BnAy.C3F@geovision.gvc.com>
  6. Organization: Not officially GeoVision Systems Inc., Ottawa, Ontario, Canada
  7. Distribution: na
  8. Date: Sat, 23 Jan 1993 19:25:44 GMT
  9. Lines: 38
  10.  
  11.  
  12. I recently had the pleasure (not) of trying to track down a bug in
  13. some C++ code.  The author(s) of the code were not that experienced
  14. in C++, but I don't think that matters here.
  15.  
  16. I just wanted to get some comments about the following.  Suppose I'm
  17. looking at a C++ program.  I have a pretty good understanding of what
  18. it does, but I'm not terribly familiar with the code.  In a member
  19. function I see:
  20.  
  21. int the_class::do_something ( )
  22. {
  23. ...
  24.     foo->xxx();
  25. ...
  26. }
  27.  
  28. Now, I'm browsing through this code and I'm thinking maybe the bug I'm
  29. looking for is in xxx().  I want to take a look at it.  In order to know
  30. which xxx to look at (since there may be many classes that have xxx), I
  31. need to know what class foo is.  But foo could be a global variable,
  32. a member of the_class, or a variable local to the function.  I have to
  33. hunt all over the place just to find out where to look for xxx.
  34.  
  35. I find this a real pain.  I'm not experienced with C++, so maybe it's
  36. something you get used to.  I think that it's a general problem with
  37. OOP, although the syntax of the language can make it better or worse.
  38. It seems that C++ is great if you know the program very well (i.e. if
  39. you designed/wrote it), but is difficult to maintain.
  40.  
  41. Are there others who find the same thing?  Is there some way of setting
  42. things up to avoid this sort of problem?
  43.  
  44. Thanks.
  45.  
  46. (I never did find that bug, by the way :-))
  47.  
  48. Darren Burns
  49.