home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!hayes!bcoleman
- From: bcoleman@hayes.com (Bill Coleman)
- Newsgroups: comp.sys.mac.oop.misc
- Subject: Re: Learning App Frameworks (was Re: THINK Class Library learning..)
- Message-ID: <6613.2b459125@hayes.com>
- Date: 2 Jan 93 12:57:09 EDT
- 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>
- Followup-To: rmute.apple.com>
- Lines: 50
-
- Organization: Hayes Microcomputer Products, Norcross, GA
- Lines: 47
-
- In article <ksand-301292103135@wintermute.apple.com>, ksand@apple.com (Kent Sandvik ) writes:
- > In article <6606.2b41845f@hayes.com>, bcoleman@hayes.com (Bill Coleman)
- > wrote:
- >> Sounds like you are suggesting people build frameworks in Eiffel, which
- >> has formal mechanisms for defining pre and post conditions for all routines.
- >> Too bad there isn't such an Eiffel implementation for the Mac.
- >
- > It's not that hard to add pre- and post-conditions with methods using
- > assertions. I have my own ASSERT macro package that is conditionally
- > compiled in during debug mode, and it certainly catches a lot of errors
- > I would not be aware of otherwise. It's a matter of strict programming
- > to add in an additional line after each error producing statement. And
- > yes indeed a language such as Eiffel helps, but it does not imply that
- > you can't do the same thing using for instance macros in C/C++.
-
- Kent,
-
- Back on an old DOS product that since was developed by another team, I
- wrote up some C++ code that did exactly this. I found it had several limitations
- that Eiffel did not.
-
- First, the C++ macros were part of the implementation, not part of the
- interface. Eiffel correctly places the pre- and post-conditions in the
- interface -- since they are just as much of the specficiation of the
- routines as anything else. I ended up having to move the implementation
- assertions as comments in the header -- it was a lot of work to keep it up
- to date and accurate.
-
- Second, you have to rigorously add all the macros to your code. If you
- forget one, even though you have a comment in the header -- it won't be
- checked. (The assertions are more code, and hence more to debug)
-
- Third, C++ doesn't have the recovery mechanism the Eiffel does, so
- without a LOT of rigorous work in every routine, your application can only
- bomb on an assertion error. (Which suffices for lots of simple conditions)
-
- Last, it has all the appearance of a kludge. It is kinda hard to program
- Eiffel in C++. It would be so much easier to program Eiffel in Eiffel.
-
- --
- Bill Coleman, AA4LR ! CIS: 76067,2327 AppleLink: D1958
- Principal Software Engineer ! Packet Radio: AA4LR @ W4QO
- Hayes Microcomputer Products, Inc. ! UUCP: uunet!hayes!bcoleman
- POB 105203 Atlanta, GA 30348 USA ! Internet: bcoleman%hayes@uunet.uu.net
- Disclaimer: "My employer doesn't pay me to have opinions."
- Quote: "The same light shines on vineyards that makes deserts." -Steve Hackett.
-
-