home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!paladin.american.edu!auvm!NETCOM.COM!ADAMSR
- X-Mailer: ELM [version 2.3 PL11]
- Message-ID: <9208180119.AA00575@netcom.netcom.com>
- Newsgroups: bit.listserv.psycgrad
- Date: Mon, 17 Aug 1992 18:19:04 PDT
- Sender: "Psychology Graduate Students Discussion Group List"
- <PSYCGRAD@UOTTAWA.BITNET>
- From: Rick Adams <adamsr@NETCOM.COM>
- Subject: Re: Computer Languages
- X-To: PSYCGRAD%UOTTAWA.BITNET@pucc.Princeton.EDU
- In-Reply-To: <m0mKBmx-000A9KC@ais.org>; from "MICHELLE HALL" at Aug 17,
- 92 1:17 pm
- Lines: 98
-
- ==>
- ==> Next week I will be starting a readings class, where we will be learning a
- ==> programming language (our program requires two computer classes). I
- ==> have a choice between Pascal and C++. I would appreciate any info anybody
- has
- ==> on either of the languages. I have no experience with either one, but
- ==> would like to know some of the benefits and drawbacks of each before
- ==> I make the choice. Also, I was wondering if other programs have
- ==> computer programming requirements.
- ==>
-
- Briefly:
-
- c++ is the current language of choice for professional programming.
- It is immensely flexible, object oriented, adaptable to any platform,
- extensible, supports a variety of memory models, and creates compact code.
-
- If there was a _single_ term above which you did not understand, and
- if you are not planning on using the language professionally, you are out of
- your mind if you choose c++!
-
- c in general, and c++ in particular, are incredibly unfriendly
- languages for the novice. For a professional, the work required to learn c++
- will be repaid by increased efficiency later - for someone who does NOT plan
- a career in programing (or who is not a dedicated computer hacker), it means
- an enormous investment of time and energy to learn something that will
- provide little value in the future.
-
- Here is a *simple* c++ program (from Lafore, R. (1990).
- _The_Waite_Group's_C_programming_using_Turbo_C++_. Carmel, IN: Sams.):
-
- class base
- {
- private:
- int base_priv;
- protected:
- int base_prot;
- public:
- int base_publ;
- };
- class pub_derv : public base
- {
- };
- pub_derv pub_derv1;
- class prv_derv : private base
- {
- };
- prv_derv prv_derv1;
- main()
- {
- pub_derv1.base_priv = 1;
- pub_derv1.base_prot = 1;
- pub_derv1.base_publ = 1;
- prv_derv1.base_priv = 1;
- prv_derv1.base_prot = 1;
- prv_derv1.base_publ = 1;
- }
-
- That was an _extremely_ simple example of c++ coding!
-
- A simple Pascal example (from Beer, M. (1982). _Programming_
- microcomputers_with_Pascal_. New York: Van Nostrand Reinhold.):
-
- PROGRAM printer(input,output);
- VAR
- ch : char;
-
- BEGIN
- page(output);
- writeln;
- writeln;
- writeln('PRINTER OPTION SELECTION PROGRAM.');
- writeln;
- . . . (repetitive code omitted to save space here)
- IF (ch='A') OR (ch='B') OR (ch='C') THEN
- CASE ch OF
- 'A' : write(chr(29));
- 'B' : write(chr(30));
- 'C' : write(chr(31));
- END
- ELSE
- BEGIN
- writeln;
- writeln;
- writeln('THIS IS NOT AN ALLOWABLE OPTION');
- END
- END.
-
- Take your pick - but I know which language *I* would select if it
- were a requirement of a program, versus personal interest (btw, I program
- in both as well as Cobol, BASIC, Fortran, ADA, and a few others - and c++
- was by FAR the most difficult to learn!).
-
- --
- rick.adams on GEnie /|\ You are right from your side,
- adamsr@netcom.com / | \ And I am right from mine.
- adamsr@irie.ais.org \ /|\ / We're both just one too many mornings,
- adamsr@norwich.bitnet \|/ And a thousand miles behind. (c Bob Dylan)
-