home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / cplus / 2018 < prev    next >
Encoding:
Text File  |  1993-01-09  |  2.3 KB  |  46 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!network.ucsd.edu!qualcom.qualcomm.com!harvey.qualcomm.com!greg
  3. From: greg@harvey.qualcomm.com (Greg Noel)
  4. Subject: Re: Use of nested functions (Was: Proposal for default scope)
  5. Message-ID: <1993Jan10.023440.27522@qualcomm.com>
  6. Sender: news@qualcomm.com
  7. Nntp-Posting-Host: harvey.qualcomm.com
  8. Organization: Qualcomm, Inc., San Diego, CA
  9. References: <1993Jan9.173310.13214@taumet.com>
  10. Date: Sun, 10 Jan 1993 02:34:40 GMT
  11. Lines: 33
  12.  
  13. Steve Clamage <steve@taumet.com> writes:
  14. >I have to disagree with this point.  C++ hides a lot of grungy detail
  15. >from the programmer, with the consequence that simple constructs may
  16. >require a lot of compiler-generated code.
  17.  
  18. There's a difference between hiding a lot of grungy detail and intrinsic
  19. inefficiency.  If the compiler filling in the grungy details is what is
  20. causing the inefficiency, the programmer can always replace it with something
  21. more efficient.  If it's inefficient because of something required by the
  22. language, that's not possible.
  23.  
  24. It's curious---I posted my original article to try to start a discussion
  25. about how something like modules or packages could be added to C++ as
  26. seamlessly as possible, because I see that as something that the language
  27. doesn't handle well and needs badly.  But most of the responses have been
  28. from people who reacted to one throw-away clause as a disparagement of
  29. nested functions, which is not what I intended at all.
  30.  
  31. Personally, I'd prefer to let those who feel passionately about nested
  32. functions debate this point.  As it is, I'm mooting a point about which
  33. I don't care very much.  In my thirty years of experience, including using
  34. languages that provided them, I've only wanted nested functions a few
  35. times---and I've _never_ wanted to take the address of one.  If I don't
  36. use them and if they don't cause me any inefficiency, then I don't really
  37. care if they are present or not.
  38.  
  39. On the other hand, there are literally hundreds of times I've wanted to
  40. have a helper function that was not externally visible.  In C, a static
  41. function provides most of the functionality I want, while in C++ it's
  42. all but impossible.  If C++ wants to be considered a ``better'' language
  43. than C, that's something that will have to be addressed.
  44. -- 
  45. -- Greg Noel, Unix Guru         greg@qualcomm.com  or  greg@noel.cts.com
  46.