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

  1. Xref: sparky alt.msdos.programmer:3002 comp.os.msdos.programmer:11600 comp.sys.ibm.pc.programmer:668 comp.lang.c++:18384 comp.lang.c:18849
  2. Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer,comp.lang.c++,comp.lang.c
  3. Path: sparky!uunet!ferkel.ucsb.edu!taco!lea.csc.ncsu.edu!bank
  4. From: bank@lea.csc.ncsu.edu (Belgarath the Sorcerer)
  5. Subject: Re: Newbie Wants Advice on C-Programming
  6. Message-ID: <1992Dec24.034656.17119@ncsu.edu>
  7. Sender: news@ncsu.edu (USENET News System)
  8. Organization: /etc/organization
  9. References: <1992Dec23.220530.15347@netcom.com>
  10. Date: Thu, 24 Dec 1992 03:46:56 GMT
  11. Lines: 158
  12.  
  13. In article <1992Dec23.220530.15347@netcom.com> noring@netcom.com (Jon Noring) writes:
  14. >Hello,
  15. >
  16. >My wife, who is a database analyst working with DB2, etc. (all IBM mainframe
  17. >stuff), is now interested in learning C programming because of pending changes
  18. >at the company she works.  I, too, have an interest in learning C - I'd like to
  19. >be able to write programs to solve a variety of problems (I've done a lot of
  20. >fairly complex scientific programming with, heaven-forbid, Fortran, so I do
  21. >have some general programming experience).
  22. >
  23. >Since both of us are newbies in this area, I'd like some advice as well as
  24. >answers to the following questions:
  25. >
  26. >1) There seems to exist C, as well as C++, and possibly other variants.  What
  27. >   are the differences between these?  Which should we learn first?
  28. >
  29. >2) We want to do most of our programming on our 386-33 PC running MSDOS 5.0.
  30. >   What C-type compilers exist for the PC?  Which ones are better?  How much
  31. >   do they cost and where can one get them at a discount?
  32. >
  33. >3) How robust is C compared to Fortran for purely number crunching, scientific
  34. >   type applications on the PC?
  35. >
  36. >4) What books would you recommend in learning C (my wife might want to take
  37. >   classes - I do better teaching myself)?  And of course, since I will be
  38. >   doing programming on a PC, what books would you recommend that are
  39. >   specific to that platform, especially w.r.t. memory management as well
  40. >   as graphics?
  41. >
  42. >
  43. >Much thanks for your help/advice.
  44. >
  45. >Jon Noring
  46. >
  47. >=============================================================================
  48. >| Jon Noring          | noring@netcom.com        | I VOTED FOR PEROT IN '92 |
  49.  
  50.     Welcome to the 20th century of computing! :-) I suspect I know
  51.  
  52. which company your wife works for, but I won't go into that. :-)
  53.  
  54.     Your questions may qualify as FAQ - I dunno. But I'll be happy
  55. to give some answers.
  56.  
  57.     1) Grammatically speaking, C++ is an extension of C. A C++ compiler
  58.         will happily compile regular old C source code; naturally, doing
  59.         so wastes all the extra power in C++
  60.  
  61.        C++ is an OOP language; that is, it was designed for Object
  62.         Oriented Programming. All of its extensions are designed to
  63.         let you do OOP.  
  64.  
  65.        C, on the other hand, is a traditional, top-down programming
  66.         language. It was designed for portability and the maximum
  67.         in extensibility. You can judge for yourself how well it 
  68.         achieves those goals.
  69.  
  70.        Which should you learn first? Well, if you want to make the
  71.         leap into OOP, start with C++. 
  72.  
  73.        HOWEVER, I suspect that simply making the jump to C will be
  74.         difficult enuf. You may not want to try to leap into OOP
  75.         at the same time. OOP and traditional programming are two
  76.         totally different mindsets. Unless you are schizo, its
  77.         extremely difficult to switch back and forth. If you're
  78.         not interested in getting into OOP, then I'd go with C.
  79.  
  80.    2) Your platform sounds good. On the PC, the major players in
  81.        the C compiler market are Borland, Microsoft, and Zortech.
  82.        There ARE others...these are just the ones that are
  83.        usually regarded as 'major'. Whatever that means.
  84.  
  85.       I'm not going to come right out and say 'X compiler is better
  86.        than Y compiler'...I'm not here to start a flamewar. 
  87.  
  88.       Borland compilers tend to compile and link faster than
  89.        the Microsoft ones. Microsofts optimizations tend to be
  90.        better. Borland's floating point emulation code runs faster
  91.        than Microsoft's, but Microsoft tends to be faster in the
  92.        integer arithmetic arena. I have never used any Zortech
  93.        compilers, but once bought some C-code libraries from
  94.        them and was EXTREMELY dissatisfied.
  95.  
  96.      You will prolly pay on the order of several hundred dollars
  97.       for a C compiler. I would look in Computer Shopper to get
  98.       the best prices. I don't have one handy. Last time I looked
  99.       at Microsoft C was Version 6.01a (it is up to Version 7
  100.       now) and it was about $350 then.
  101.  
  102.   3) Unlike FORTRAN (and Pascal and some other languages), C have
  103.       (excuse me, has) very little in the way of built-in
  104.       number-crunching functions. Some compilers include math
  105.       libraries that do a decent job...but these are extensions,
  106.       not part of the C language itself, so the functions and
  107.       their usages vary from compiler to compiler.
  108.  
  109.      You see (no pun intended), in order to give C the maximum in
  110.       flexability, its designers (Kernigan and Ritchie) only put
  111.       a minimum of I/O and math functions in the language. To
  112.       do things like complex math and string ops and so forth you
  113.       get libraries of routines. If the numeric-processing library
  114.       that comes with your compiler doesn't pack the oompf you
  115.       need, all you have to do is go get another, more powerful
  116.       one and link it in and you can use it instead.
  117.  
  118.      This contrasts with languages like FORTRAN, where all this
  119.       stuff is built-in. And if your particular implementation
  120.       of FORTRAN has any shortcomings, too bad. You can't switch
  121.       parts out. C lets you select the library of routines that
  122.       best fits your needs.
  123.  
  124.      Also, C is MUCH more memory efficient than FORTRAN. But then
  125.       FORTRAN is an old has-been. ANSI blew FORTRAN's chance to
  126.       be a real language when the dropped pointers from its
  127.       revision (altho some compiler-makers have wisely decided
  128.       to ignore ANSI in this case and added pointers anyway). 
  129.  
  130.   4) Hmmm. Part of this depends on what compiler you choose. I have
  131.       done 80% of my work in C using Microsoft C (first Version 5.1,
  132.       later 6.0). I found "The Waite Group's Microsoft C Bible"
  133.       (2nd Ed.) to be a very good reference. ISBN 0-672-22736-3.
  134.       They also put out another good book, called "MS-DOS Developer's
  135.       Guide" which had lotsa stuff on memory management and graphics.
  136.       ISBN 0-672-22630-8. As for learning how to program in C,
  137.       a book titled "Variations in C" (2nd Ed.) seemed to be pretty
  138.       decent. ISBN 1-55615-285-X. Two other books you might find
  139.       useful are "DOS Programmer's Reference", ISBN 0-88022-458-4
  140.       and "The Programmer's PC Sourcebook" (2nd Ed),     
  141.       ISBN 1-55615-321-X. 
  142.  
  143.    A course at a local college or university is prolly a good place
  144. to start off learning C. Make sure the course on C is a regular
  145. part of their curriculum and not just taught occasionally by some
  146. guy who usually teaches BASIC.
  147.    Depending on how fast you pick things up, you can expect to
  148. spend 6 months to a year programmin C (or C++, for that matter)
  149. before you reach any real level of proficiency. I look back at the
  150.  
  151. code I wrote during the first 6 months I spent writing C and I
  152. shudder in revulsion.  
  153.    If you have been a mainframe-type for many years, do not expect to
  154. pick C up in a week. Pointers are likely to be a major stumbling
  155. block - I doubt DB2 has anything like them. C is going to be a whole
  156. new way of thinking - it is a language that assumes you know what you
  157. are doing and gives you plenty of rope to do whatever you want, 
  158. including hanging yourself.
  159.  
  160.    Good luck.
  161.  
  162. Belgarath the Sorcerer
  163. bank@lea.csc.ncsu.edu
  164.  
  165. DISCLAIMER: The above message constitutes an honest effort by the
  166.              author to impart information he knows, or reasonably
  167.              knows, to be true. All other interpretations are in
  168.              error.
  169.  
  170.  
  171.