home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / msdos / programm / 3039 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  2.5 KB

  1. Xref: sparky alt.msdos.programmer:3039 comp.os.msdos.programmer:11668 comp.sys.ibm.pc.programmer:696 comp.lang.c++:18495 comp.lang.c:18959
  2. Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer,comp.lang.c++,comp.lang.c
  3. Path: sparky!uunet!microsoft!wingnut!pauljo
  4. From: pauljo@microsoft.com (Paul Johns)
  5. Subject: Re: Newbie Wants Advice on C-Programming
  6. Message-ID: <1992Dec29.035013.18103@microsoft.com>
  7. Date: 29 Dec 92 03:50:13 GMT
  8. Organization: Microsoft Corp.
  9. References: <1992Dec28.051247.11699@grebyn.com> <1992Dec25.073517.16089@grebyn.com> <1992Dec27.031740.27262@mole-end.matawan.nj.us> <1992Dec28.003320.5437@sequent.com>
  10. Distribution: usa
  11. Lines: 51
  12.  
  13. It's up to you whether you learn C or C++ first.
  14. Anything you learn in C will apply to C++, so you
  15. won't hurt yourself by learning C first.
  16.  
  17. A lot would depend on the book you choose.  Many
  18. C++ books assume you know C.
  19.  
  20. **BUT**, whatever you do, ALWAYS use a C++ compiler,
  21. even if you're programming in C.  C++ has much stronger
  22. type-checking than C does, and it will catch many errors
  23. that would cause your system to crash.  You may even find
  24. bugs in your book's examples!
  25.  
  26. Because of this type-checking, C++ is an appropriate
  27. language for beginning computer science students, and
  28. it's used that way at some universities.  C is much more
  29. difficult as a first language.
  30.  
  31. If you do C++, **DON'T** try to create your own classes,
  32. particularly classes with dynamic data, until you understand
  33. C pointers well.
  34.  
  35. But it's OK to use someone else's class libraries (such as
  36. for strings or complex numbers or whatever).  And it's OK 
  37. to do very simple classes.
  38.  
  39. Using someone else's well-designed classes is some of the
  40. easiest programming you can do; writing your own non-
  41. trivial classes is some of the hardest programming you can
  42. do.
  43.  
  44. Finally, while it's true that neither C nor C++ have an
  45. exponentiation operator, the standard library DOES come
  46. with a function that does exponentiation.  While it makes
  47. the syntax look a little funny, you can write anything you
  48. can write in FORTRAN given the pow() function and a complex
  49. number class.
  50.  
  51. In addition to the books already mentioned, 
  52. I like the Waite Groups C Primer Plus and C++ Primer Plus
  53. books.  I tried to use K & R once for a community college
  54. class and changed texts the very next term.  The examples
  55. are fabulous in K & R, but the text is overly terse for
  56. many people.
  57.  
  58. The tutorials that come with the Microsoft compiler are,
  59. IMHO, excellent.  BTW, it's MUCH  easier to use it under 
  60. Windows than under DOS and the performance is really
  61. quite good.
  62.  
  63. // Paul Johns
  64.