home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / oop / misc / 149 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  3.0 KB

  1. Path: sparky!uunet!hayes!bcoleman
  2. From: bcoleman@hayes.com (Bill Coleman)
  3. Newsgroups: comp.sys.mac.oop.misc
  4. Subject: Re: Learning App Frameworks (was Re: THINK Class Library learning..)
  5. Message-ID: <6613.2b459125@hayes.com>
  6. Date: 2 Jan 93 12:57:09 EDT
  7. References: <1992Dec1.220344.234@physc1.byu.edu> <1992Dec3.064131.23364@reed.edu> <Dec.3.13.57.31.1992.18090@gandalf.rutgers.edu> <1992Dec4.081456.13906@reed.edu> <1992Dec29.213057.14290@news.mentorg.com> <6606.2b41845f@hayes.com> <ksand-301292103135@wintermute.apple.com>
  8. Followup-To: rmute.apple.com>
  9. Lines: 50
  10.  
  11. Organization: Hayes Microcomputer Products, Norcross, GA
  12. Lines: 47
  13.  
  14. In article <ksand-301292103135@wintermute.apple.com>, ksand@apple.com (Kent Sandvik ) writes:
  15. > In article <6606.2b41845f@hayes.com>, bcoleman@hayes.com (Bill Coleman)
  16. > wrote:
  17. >> Sounds like you are suggesting people build frameworks in Eiffel, which
  18. >> has formal mechanisms for defining pre and post conditions for all routines.
  19. >> Too bad there isn't such an Eiffel implementation for the Mac.
  20. > It's not that hard to add pre- and post-conditions with methods using 
  21. > assertions. I have my own ASSERT macro package that is conditionally
  22. > compiled in during debug mode, and it certainly catches a lot of errors
  23. > I would not be aware of otherwise. It's a matter of strict programming
  24. > to add in an additional line after each error producing statement. And 
  25. > yes indeed a language such as Eiffel helps, but it does not imply that
  26. > you can't do the same thing using for instance macros in C/C++.
  27.  
  28. Kent,
  29.  
  30. Back on an old DOS product that since was developed by another team, I 
  31. wrote up some C++ code that did exactly this. I found it had several limitations
  32. that Eiffel did not.
  33.  
  34. First, the C++ macros were part of the implementation, not part of the
  35. interface. Eiffel correctly places the pre- and post-conditions in the
  36. interface -- since they are just as much of the specficiation of the
  37. routines as anything else. I ended up having to move the implementation
  38. assertions as comments in the header -- it was a lot of work to keep it up
  39. to date and accurate.
  40.  
  41. Second, you have to rigorously add all  the macros to your code. If you 
  42. forget one, even though you have a comment in the header -- it won't be
  43. checked. (The assertions are more code, and hence more to debug)
  44.  
  45. Third, C++ doesn't have the recovery mechanism the Eiffel does, so
  46. without a LOT of rigorous work in every routine, your application can only
  47. bomb on an assertion error. (Which suffices for lots of simple conditions)
  48.  
  49. Last, it has all the appearance of a kludge. It is kinda hard to program
  50. Eiffel in C++. It would be so much easier to program Eiffel in Eiffel.
  51.  
  52. -- 
  53. Bill Coleman, AA4LR                ! CIS: 76067,2327    AppleLink: D1958
  54. Principal Software Engineer        ! Packet Radio: AA4LR @ W4QO
  55. Hayes Microcomputer Products, Inc. ! UUCP: uunet!hayes!bcoleman
  56. POB 105203 Atlanta, GA 30348 USA   ! Internet: bcoleman%hayes@uunet.uu.net
  57. Disclaimer: "My employer doesn't pay me to have opinions."
  58. Quote: "The same light shines on vineyards that makes deserts." -Steve Hackett.
  59.  
  60.