home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17848 < prev    next >
Encoding:
Text File  |  1992-12-11  |  1.5 KB  |  33 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: portability
  5. Message-ID: <1992Dec11.223158.8029@microsoft.com>
  6. Date: 11 Dec 92 22:31:58 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Dec3.051057.14688@siswat.hou.tx.us> <1992Dec04.235922.12074@microsoft.com> <719@ulogic.UUCP>
  9. Lines: 22
  10.  
  11. In article <719@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
  12. |In article <1992Dec04.235922.12074@microsoft.com> jimad@microsoft.com (Jim Adcock) writes:
  13. |>
  14. |>In my experience C++ code is MUCH more portable than C because much of
  15. |>the system-dependency hacks tend to be naturally encapsulated in one
  16. |>class.  So one tends to find the system dependency once in one class,
  17. |>fix it, and then "never" run into that problem again.  In "C" code I
  18. |>tend to find the same system-dependent hack in the code over and over
  19. |>again at different locations or in slightly different forms.
  20. |
  21. |Of course, in well written C the system-dependant stuff should
  22. |be isolated into sub-routines, which are clearly labeled as
  23. |system dependant.            ;-)
  24.  
  25. Such is the difference between theory and practice.  I'm saying in
  26. my experience, in practice, the C++ code proves to be easier to port.
  27. This is because [I believe] that the use of classes leads naturally to
  28. at least some degree of encapsulation and modularity.  C programmers can
  29. and do write code without either.  Its great to talk about portability, 
  30. as long as one realizes that the vast majority of C/C++ code is written
  31. without any attempt at portability.
  32.  
  33.