home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / bit / listserv / psycgrad / 3264 < prev    next >
Encoding:
Text File  |  1992-08-17  |  3.6 KB  |  114 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!NETCOM.COM!ADAMSR
  3. X-Mailer: ELM [version 2.3 PL11]
  4. Message-ID: <9208180119.AA00575@netcom.netcom.com>
  5. Newsgroups: bit.listserv.psycgrad
  6. Date:         Mon, 17 Aug 1992 18:19:04 PDT
  7. Sender:       "Psychology Graduate Students Discussion Group List"
  8.               <PSYCGRAD@UOTTAWA.BITNET>
  9. From:         Rick Adams <adamsr@NETCOM.COM>
  10. Subject:      Re: Computer Languages
  11. X-To:         PSYCGRAD%UOTTAWA.BITNET@pucc.Princeton.EDU
  12. In-Reply-To:  <m0mKBmx-000A9KC@ais.org>; from "MICHELLE HALL" at Aug 17,
  13.               92 1:17 pm
  14. Lines: 98
  15.  
  16. ==>
  17. ==> Next week I will be starting a readings class, where we will be learning a
  18. ==> programming language (our program requires two computer classes).  I
  19. ==> have a choice between Pascal and C++.  I would appreciate any info anybody
  20.  has
  21. ==> on either of the languages.  I have no experience with either one, but
  22. ==> would like to know some of the benefits and drawbacks of each before
  23. ==> I make the choice.  Also, I was wondering if other programs have
  24. ==> computer programming requirements.
  25. ==>
  26.  
  27.     Briefly:
  28.  
  29.     c++ is the current language of choice for professional programming.
  30. It is immensely flexible, object oriented, adaptable to any platform,
  31. extensible, supports a variety of memory models, and creates compact code.
  32.  
  33.     If there was a _single_ term above which you did not understand, and
  34. if you are not planning on using the language professionally, you are out of
  35. your mind if you choose c++!
  36.  
  37.     c in general, and c++ in particular, are incredibly unfriendly
  38. languages for the novice. For a professional, the work required to learn c++
  39. will be repaid by increased efficiency later - for someone who does NOT plan
  40. a career in programing (or who is not a dedicated computer hacker), it means
  41. an enormous investment of time and energy to learn something that will
  42. provide little value in the future.
  43.  
  44.     Here is a *simple* c++ program (from  Lafore, R. (1990).
  45. _The_Waite_Group's_C_programming_using_Turbo_C++_. Carmel, IN: Sams.):
  46.  
  47.     class base
  48.     {
  49.        private:
  50.         int base_priv;
  51.        protected:
  52.         int base_prot;
  53.        public:
  54.         int base_publ;
  55.     };
  56.     class pub_derv : public base
  57.     {
  58.     };
  59.     pub_derv pub_derv1;
  60.     class prv_derv : private base
  61.     {
  62.     };
  63.     prv_derv prv_derv1;
  64.     main()
  65.     {
  66.        pub_derv1.base_priv = 1;
  67.        pub_derv1.base_prot = 1;
  68.        pub_derv1.base_publ = 1;
  69.        prv_derv1.base_priv = 1;
  70.        prv_derv1.base_prot = 1;
  71.        prv_derv1.base_publ = 1;
  72.     }
  73.  
  74.     That was an _extremely_ simple example of c++ coding!
  75.  
  76.     A simple Pascal example (from Beer, M. (1982). _Programming_
  77. microcomputers_with_Pascal_. New York: Van Nostrand Reinhold.):
  78.  
  79.     PROGRAM printer(input,output);
  80.     VAR
  81.        ch    : char;
  82.  
  83.     BEGIN
  84.        page(output);
  85.        writeln;
  86.        writeln;
  87.        writeln('PRINTER OPTION SELECTION PROGRAM.');
  88.        writeln;
  89.     . . . (repetitive code omitted to save space here)
  90.        IF (ch='A') OR (ch='B') OR (ch='C') THEN
  91.         CASE ch OF
  92.            'A' : write(chr(29));
  93.            'B' : write(chr(30));
  94.            'C' : write(chr(31));
  95.         END
  96.        ELSE
  97.         BEGIN
  98.            writeln;
  99.            writeln;
  100.            writeln('THIS IS NOT AN ALLOWABLE OPTION');
  101.         END
  102.     END.
  103.  
  104.     Take your pick - but I know which language *I* would select if it
  105. were a requirement of a program,  versus personal interest (btw, I program
  106. in both as well as Cobol, BASIC, Fortran, ADA, and a few others - and c++
  107. was by FAR the most difficult to learn!).
  108.  
  109. --
  110.     rick.adams on GEnie   /|\        You are right from your side,
  111.      adamsr@netcom.com  /  |  \        And I am right from mine.
  112.     adamsr@irie.ais.org \ /|\ /  We're both just one too many mornings,
  113.    adamsr@norwich.bitnet  \|/  And a thousand miles behind. (c Bob Dylan)
  114.