home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15868 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.2 KB  |  64 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!gumby!yale!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!bcm!rice!amitp
  3. From: amitp@rice.edu (Amit J. Patel)
  4. Subject: Re: PROPOSAL: Hidden private parts of classes
  5. Message-ID: <BxAt2x.HG6@rice.edu>
  6. Originator: amitp@aten.cs.rice.edu
  7. Sender: news@rice.edu (News)
  8. Reply-To: amitp@owlnet.rice.edu
  9. Organization: Rice University
  10. References: <1992Oct30.113234.15010@daimi.aau.dk> <1992Nov2.170018.12614@unix.brighton.ac.uk> <1992Nov4.200426.24424@netcom.com>
  11. Distribution: usa
  12. Date: Fri, 6 Nov 1992 14:18:32 GMT
  13. Lines: 49
  14.  
  15.  
  16. In article <1992Nov4.200426.24424@netcom.com>, ort@netcom.com (David Oertel) writes:
  17. |> 
  18. |> I'd like to make a pragmatic point concerning not exposing your private parts.
  19. |> My 15k line program brought my 33mhz 486 to its knees until I started using 
  20. |> this technique.  Header file dependencies cascade rapidly and tend to force 
  21. |> a near full-rebuild when a header file needs changing.
  22. |> 
  23. |> ort@netcom.com
  24. |> -- 
  25.  
  26. Same here!  :)
  27.  
  28. Perhaps the solution lies in the programming environment --- maybe our
  29. notion of "header" and "code" files needs to be changed.
  30.  
  31. Maybe:
  32.  
  33.  
  34. Public Interface    .h    -> gets #include-d
  35. Private structure    .hp    -> gets compiled to .op
  36. Code            .cc    -> gets compiled to .o
  37.  
  38. The makefile would have two sets of files to compile:
  39.  
  40.     1 - compile all .hp files to .op files; if a .hp file
  41.         includes A.h, and A.h is changed, A.hp must be
  42.         recompiled.  This will produce a .op file which
  43.         describes the structure to the compiler
  44.  
  45.     2 - compile all .cc files to .o files; if it includes
  46.         a .h file that needs private stuff, the compiler
  47.         can look in the .op file for the layout.  Since it's
  48.         already parsed & converted to internal form, it should 
  49.         be fast.
  50.  
  51. Does this seem reasonable?  An implementor can give out .h and .op
  52. files, so that the user doesn't see the .hp file.  The .hp file
  53. doesn't have to be recompiled every time, and those of us with 486s
  54. don't have to wait for hours recompiling.  :)
  55.  
  56.         
  57.  
  58.             Amit
  59.  
  60.  
  61.  
  62. P.S.  Building my 4000 line program manages to get **150,000***
  63.       lines after all the #includes.  It drives me up the wall!
  64.