home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / oop / macapp3 / 599 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  2.7 KB

  1. Path: sparky!uunet!think.com!rpi!uwm.edu!ogicse!reed!bowman
  2. From: bowman@reed.edu (BoBolicious)
  3. Newsgroups: comp.sys.mac.oop.macapp3
  4. Subject: Re: C++ (was re: bedrock defection
  5. Message-ID: <1993Jan24.221920.13361@reed.edu>
  6. Date: 24 Jan 93 22:19:20 GMT
  7. Article-I.D.: reed.1993Jan24.221920.13361
  8. References: <727841301.8123714@AppleLink.Apple.COM>
  9. Organization: Reed College, Portland, OR
  10. Lines: 38
  11.  
  12. In article <727841301.8123714@AppleLink.Apple.COM> ALANDAIL@AppleLink.Apple.COM (Personal Software, Alan Dail,PRT) writes:
  13. >I would tend to disagree.  C and C++ both allow so many things to compile that
  14. >could easily be typos but cause the program to do the wrong thing (I do admit
  15. >that C++ is better than C).  For example, anywhere you can use a ==, you can
  16. >also use = (and vice versa) and have the program compile fine (due to the
  17. >definition of the language), but get different results.  Your program will not
  18. >only compile, but may even work fine in some instances.  It doesn't even stand
  19. >out when you are looking over your code.  This error would be cought in Pascal
  20. >(or even in Pascal '9x), but not in C or C++.
  21.  
  22. MPW C++ will warn you if you use a "=" inside an if.  The biggest problem
  23. I had switching from C to C++ was that I didn't pay enough attention to
  24. the warnings that CFront emits.  My C code was so "warning-laden" that I
  25. tended to just ignore them, but CFront can be quite helpful.  It could be
  26. better, though, I admit.
  27.  
  28. >There are other many other problems like this that are part of the language and
  29. >not due to the compiler.  This doesn't even address the other language problems
  30. >like having various features clash when used together or having the wrong
  31. >defaults when using features (why isn't virtual the default?).  It's a shame
  32. >that Apple doesn't appear to be doing anything with Pascal '9x which appears to
  33. >give programmers the power of C++ without nearly as many pitfalls.
  34.  
  35. Do you have any more examples?  I've found C++ to be an ideal mix of flexible
  36. elegance & stiff type-checking.  The biggest gotcha for me is usually a bad
  37. typecast, which if I understand correctly, Pascal allows as well.  Properly
  38. written C++ code can pretty stable; it took many shots-to-the-foot, for
  39. instance, before I was fully convinced that initializing everything to nil
  40. and then checking everything before using it is truly The Way (tm).
  41.  
  42. cheers,
  43. bobo              In seeking the unattainable,
  44. bowman@reed.edu            simplicity only gets in the way.
  45. Best personal ad ever:
  46. "Functionally dysfunctional bi-polar former pop-star geek with Valium habit
  47. seeks anorexic queen of darkness for co-dependency.  Hobbies include: passing
  48. out, slurred speech, blurred vision and reliving past glory."
  49. _Willamette Week_, 1/7-13/93
  50.