home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / alt / cobol / 650 < prev    next >
Encoding:
Internet Message Format  |  1993-01-10  |  2.7 KB

  1. 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
  2. From: n087ec@tamuts.tamu.edu (Hessel Kooistra)
  3. Newsgroups: alt.cobol
  4. Subject: Re: Re; Why COBOL for the 90's
  5. Message-ID: <1iplu2INN7di@tamsun.tamu.edu>
  6. Date: 10 Jan 93 17:21:06 GMT
  7. References: <C09oyv.HEt.1@cs.cmu.edu> <21P3wB1w165w@ruth.UUCP> <1993Jan10.161639.16400@wisdom.bubble.org>
  8. Organization: ~/lib/organization
  9. Lines: 58
  10. NNTP-Posting-Host: tamuts.tamu.edu
  11.  
  12. In article <21P3wB1w165w@ruth.UUCP> rat@ruth.UUCP (David Douthitt) writes:
  13. >drake+@cs.cmu.edu (Drake) writes:
  14. >
  15. >| I agree.  However, I'm just starting out in COBOL; could I have a few
  16. >| examples where the advantage of COBOL is clearly shown?
  17. >
  18. >Well...... how do you suppose you would subtract a from b giving c?
  19. >Um... the statement reads SUBTRACT A FROM B GIVING C.  What could
  20. >be easier?
  21.  
  22. IBM 370 Assembler (been a while...)  :  L   Rx,B
  23.                                         S   Rx,A
  24.                                         ST  Rx,C
  25.  
  26. BASIC, C, FORTRAN, Pascal, Clipper...:  C=B-A
  27.  
  28.                                 COBOL:  SUBTRACT A FROM B GIVING C.
  29.                                           -or-
  30.                                         COMPUTE C = B - A.
  31.  
  32. Which is easiest?  Personally, I prefer BASIC, C, FORTRAN, Pascal, Clipper
  33. and probably more which I can't think of at the moment.  Additionally,
  34. when thinking of ease of use, you have to figure in what it takes to set
  35. up your variables.  Cobol is by far the most verbose in that area, with
  36. three comparatively long lines of code just to set up A, B and C:
  37.  
  38.        DATA DIVISION
  39.             .
  40.             .
  41.             .
  42.        77  A                                   PIC 9(5)V99 VALUE 0.
  43.        77  B                                   PIC 9(5)V99 VALUE 0.
  44.        77  C                                   PIC 9(5)V99 VALUE 0.
  45.  
  46. versus, say, C which would be:
  47.  
  48. float A,B,C;
  49. A=B=C=0.;
  50.  
  51. or BASIC which does not need any initializations.
  52.  
  53. But, COBOL has better IO than Assembler, and is easier to use with
  54. floating point than Assembler.  I would not argue that.
  55.  
  56. As for the original posters querry as to where the big advantage of
  57. COBOL lies, I would have to say that the formatted IO would have to
  58. be it.  Of course, one function in any other language would just about
  59. take care of that advantage.
  60.  
  61. The real advantage of COBOL and why it is still around is that just about
  62. any non-programming fool can look at a COBOL listing and figure out
  63. what is going on.  That is a very big advantage over a language like C
  64. which can get pretty far out.  COBOL is the language of the IRS, set up so
  65. that businesses can not hide behind their accounting software.
  66.  
  67. Just my $.02 worth.
  68.  
  69. Hessel
  70.