home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / objectiv / 501 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  1.9 KB

  1. Path: sparky!uunet!casey!gaboon!seltd!lerman
  2. From: lerman@seltd.UUCP (Kenneth Lerman)
  3. Newsgroups: comp.lang.objective-c
  4. Subject: Re: Objective-C vs. C++
  5. Message-ID: <20@seltd.UUCP>
  6. Date: 29 Aug 92 14:42:36 GMT
  7. References: <rmartin.714926059@thor> <1992Aug28.182704.10020@cs.mcgill.ca>
  8. Reply-To: lerman@seltd.UUCP (Kenneth Lerman)
  9. Organization: Systems Essentials Limited
  10. Lines: 43
  11.  
  12. In article <1992Aug28.182704.10020@cs.mcgill.ca> samurai@uriel.cs.mgill.ca writes:
  13. ...referring to type checking...
  14. >Isn't ANSI C pretty strong about this? I know gcc2.2.2 drives me
  15. >WILD with warnings :-). And Objective C (well, NeXT's anyway)
  16. >is ANSI.
  17. ...
  18.  
  19. Recall that Stepstone's compiler is a precompiler which generates C
  20. code as output.
  21.  
  22. Stepstone's Objective-C compiler accepts ANSI C and generates ANSI or
  23. K&R variants depending on whether it is used with ANSI or K&R
  24. compilers.  It will do type checking of messages to objects whose
  25. types are statically defined, e.g.:
  26.  
  27.     Foo *aFoo;
  28.     ...
  29.     [aFoo blech];
  30.  
  31. will verify that objects of type Foo respond to the blech message.  A
  32. diagnostic will be generated if it does not.
  33.  
  34. One objection to runtime dispatching of messages which is often made
  35. by the C++ advocates is that you may get "doesNotRecognize" errors
  36. during runtime if your code is not statically checked by the compiler.
  37. My answer to this is:
  38.   You mean you don't test your code?
  39.  
  40. It has been my experience that doesNotRecognize errors are generally
  41. easy to find and fix.
  42.  
  43. That is in contrast to the correction of memory leaks and messages to
  44. freed objects.  The former is easy to detect and often very hard to
  45. understand and fix.  The latter is usually easily detected by the
  46. Objective-C runtime, but is sometimes very hard to detect and may take
  47. days to understand and fix.
  48.  
  49.  
  50. -- 
  51. Kenneth Lerman                  ...!uunet!casey!gaboon!seltd!lerman
  52. Systems Essentials Limited                            (203)426-4430
  53. 55 Main Street
  54. Newtown, CT 06470
  55.