home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19906 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  3.4 KB

  1. Xref: sparky comp.lang.c++:19906 comp.object:5058
  2. Newsgroups: comp.lang.c++,comp.object
  3. Path: sparky!uunet!portal!samantha
  4. From: samantha@shell.portal.com (Samantha Atkins)
  5. Subject: Re: Pros and cons of C++
  6. Message-ID: <C1G9H4.HsA@unix.portal.com>
  7. Sender: news@unix.portal.com
  8. Nntp-Posting-Host: jobe
  9. Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
  10. References: <MUTS.93Jan13090705@PMCS.estec.esa.nl> <1993Jan13.215141.14487@informix.com> <TMB.93Jan14144656@arolla.idiap.ch>
  11. Date: Tue, 26 Jan 1993 07:15:03 GMT
  12. Lines: 54
  13.  
  14. In article <TMB.93Jan14144656@arolla.idiap.ch> tmb@idiap.ch writes:
  15. >In article <1993Jan13.215141.14487@informix.com> cshaver@informix.com (Craig Shaver) writes:
  16. >
  17. >   We have been fed strong type checking for some time via Nick Wirth and
  18. >   the original pascal teaching language.  This led to ADA which is still-born
  19. >   in the commercial world.
  20. >
  21. >Pascal's, Ada's, and C's type systems are quite antiquated. Many
  22. >modern "strong" type checkers (static type checkers) are very
  23. >expressive and flexible; for much of the code written for such type
  24. >checkers, you wouldn't even be able to tell whether the code is
  25. >statically or dynamically typed.
  26. >
  27. >                    Thomas.
  28.  
  29. Hmmmm.  It seems to me that a couple of problems exist with all the static
  30. type languages (compile time checking) that I am familiar with.
  31.  
  32. The first problem is that such languages require recompilation of any and
  33. all affected code whenever the type hierarchy is reworked even if this 
  34. results in no changes at all to the behavior of any objects in the application.
  35. In practice for larger projects this is an unholy terror.  I may be wrong
  36. but I thought that one of the blessings of OO was being able to refine a
  37. design even with working code in the field with little or no impact.  
  38.  
  39. The second problem is related in that most such languages use type based
  40. checking.  It seems to me that what we are really concerned with is:
  41.     a) does this object understand the message we are sending?
  42.     b) does its behavior conform to what we intended in response?
  43. No object language I am aware of does a message based much less a decent
  44. semantic based check.  So in what way has safety been assured really?
  45. Only in that the type understands the message.  OK.  So if I want to get
  46. the maximum flexibility I would probably tend to factor my class hierarchy
  47. very highly with lots and lots of mix-in classes for every reasonable 
  48. set of behaviors.  Then for working classes I would mix and match to 
  49. produce just what I need.  Here we run into some sticky situations in that
  50. not only would I need all these little mixins but I would also quite likely
  51. need various equally abstract classes that represent various combinations
  52. of them as my typing of say, parameters, is only class based and I want to
  53. leave maximum flexibility and reuse in.  Now it seems pretty obvious to me
  54. that over time I'm going to want to change this around or add more combinations
  55. as I can't just declare the whole exponential mess right the first time.  
  56. Also we would have to contend with the unpleasant fact that all this churning
  57. through this exponentially growing hierarchy takes real CPU time and resources
  58. that eventually will get very seriously strained.
  59.  
  60. Am I going askew here or is it as it seems to me that so called strong typing
  61. creates an untenable mess if you seriously attempt its use now and for the
  62. future?
  63.  
  64. Comments?
  65.  
  66. Samantha Atkins
  67. Object Enterprises
  68.