home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!doc.ic.ac.uk!agate!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!tamsun.tamu.edu!tamuts!n087ec
- From: n087ec@tamuts.tamu.edu (Hessel Kooistra)
- Newsgroups: alt.cobol
- Subject: Re: Re; Why COBOL for the 90's
- Message-ID: <1iplu2INN7di@tamsun.tamu.edu>
- Date: 10 Jan 93 17:21:06 GMT
- References: <C09oyv.HEt.1@cs.cmu.edu> <21P3wB1w165w@ruth.UUCP> <1993Jan10.161639.16400@wisdom.bubble.org>
- Organization: ~/lib/organization
- Lines: 58
- NNTP-Posting-Host: tamuts.tamu.edu
-
- In article <21P3wB1w165w@ruth.UUCP> rat@ruth.UUCP (David Douthitt) writes:
- >drake+@cs.cmu.edu (Drake) writes:
- >
- >| I agree. However, I'm just starting out in COBOL; could I have a few
- >| examples where the advantage of COBOL is clearly shown?
- >
- >Well...... how do you suppose you would subtract a from b giving c?
- >Um... the statement reads SUBTRACT A FROM B GIVING C. What could
- >be easier?
-
- IBM 370 Assembler (been a while...) : L Rx,B
- S Rx,A
- ST Rx,C
-
- BASIC, C, FORTRAN, Pascal, Clipper...: C=B-A
-
- COBOL: SUBTRACT A FROM B GIVING C.
- -or-
- COMPUTE C = B - A.
-
- Which is easiest? Personally, I prefer BASIC, C, FORTRAN, Pascal, Clipper
- and probably more which I can't think of at the moment. Additionally,
- when thinking of ease of use, you have to figure in what it takes to set
- up your variables. Cobol is by far the most verbose in that area, with
- three comparatively long lines of code just to set up A, B and C:
-
- DATA DIVISION
- .
- .
- .
- 77 A PIC 9(5)V99 VALUE 0.
- 77 B PIC 9(5)V99 VALUE 0.
- 77 C PIC 9(5)V99 VALUE 0.
-
- versus, say, C which would be:
-
- float A,B,C;
- A=B=C=0.;
-
- or BASIC which does not need any initializations.
-
- But, COBOL has better IO than Assembler, and is easier to use with
- floating point than Assembler. I would not argue that.
-
- As for the original posters querry as to where the big advantage of
- COBOL lies, I would have to say that the formatted IO would have to
- be it. Of course, one function in any other language would just about
- take care of that advantage.
-
- The real advantage of COBOL and why it is still around is that just about
- any non-programming fool can look at a COBOL listing and figure out
- what is going on. That is a very big advantage over a language like C
- which can get pretty far out. COBOL is the language of the IRS, set up so
- that businesses can not hide behind their accounting software.
-
- Just my $.02 worth.
-
- Hessel
-