[net.lang] If "MERRY XMAS" in COBOL is a must, then at least make it Structured

jrc@ritcv.UUCP (James R Carbin) (11/15/83)

If we must have a COBOL version of PRINT  "MERRY CHRISTMAS,"  let's at least
make it structured...... Here is one version of such a program.

        IDENTIFICATION DIVISION.
        PROGRAM-ID.  MERRY-XMAS.

        ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.
        SOURCE-COMPUTER. VAX11.
        OBJECT-COMPUTER. VAX11.

        DATA DIVISION.
        WORKING-STORAGE SECTION.
        77  COUNTER-FOR-LOOP    PICTURE 9(2)   COMPUTATIONAL.

        PROCEDURE DIVISION.
        PRINT-CONTROL-LOOP.
            PERFORM  PRINT-IT  VARYING  COUNTER-FOR-LOOP
                FROM  1 BY  1 UNTIL  COUNTER-FOR-LOOP  >  15
            STOP RUN.
        PRINT-IT.
            DISPLAY  "MERRY CHRISTMAS".

Of course this code is *NOT* properly commented nor necessarily well written.
Isn't this an absurd number of lines of code just to accomplish such a simple
task?

p.s.    C is my most favorite programming language and PASAL my second. 

p.p.s.  I am a charter member of the Society to Help Stamp Out BASIC!

as ever,

j.r.           {allegra,seismo}!rochester!ritcv!jrc

bprice@bmcg.UUCP (11/17/83)

Path: bmcg!sdcsvax!dcdwest!ittvax!decvax!harpo!seismo!rochester!ritcv!jrc
From: jrc@ritcv.UUCP

>If we must have a COBOL version of PRINT  "MERRY CHRISTMAS,"  let's at least
>make it structured...... Here is one version of such a program.
--The lower-case is my modifications to the original to make it shorter and
  representative of COBOL usage (as I [mis?]understand it).
        IDENTIFICATION DIVISION.
        PROGRAM-ID.  MERRY-XMAS.

        ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.
        SOURCE-COMPUTER. VAX11.
        OBJECT-COMPUTER. VAX11.

        PROCEDURE DIVISION.
        PRINT-CONTROL-LOOP.
            PERFORM  PRINT-IT  15 times.
            STOP RUN.
        PRINT-IT.
            DISPLAY  "MERRY CHRISTMAS".

>Of course this code is *NOT* properly commented nor necessarily well written.
>Isn't this an absurd number of lines of code just to accomplish such a simple
>task?
--Yes, it is.  COBOL is definitely not a language for short programs by
  amateurs.  COBOL is, however, a powerful language within its own scope.  
  The fact of its continued use, as the most popular of all programming
  languages, says a lot about it.  (I can't give a source, but I have heard
  that more programs have been written in COBOL than in all other languages
  combined; and further, except for the COBOL programs, the same is true
  for FORTRAN!)
    It must be that there is something very good, in some sense, about COBOL!
-- 
--Bill Price    uucp:   {decvax!ucbvax  philabs}!sdcsvax!bmcg!bprice
                arpa:?  sdcsvax!bmcg!bprice@nosc

mark@cbosgd.UUCP (11/22/83)

FORTRAN and COBOL have been around for over 20 years.  This implies
that (a) there have been 20 years for programs to be written, and
(b) there are a lot of people out there that know only COBOL or
only FORTRAN and therefore program exclusively in that language.
Consider also that IBM has supported both languages very well for
the whole 20 years.  Finally, consider that until recently, computers
were too expensive for mere people to buy, and while some companies
need scientific computers or special purposes computers or develop
software, nearly every large company 20 years ago needed a computer
to print paychecks, do inventory, and so on.  And of course these
programs were all written in COBOL since they are traditional COBOL
applications (business oriented, I/O bound programs with little or
no computation).

Thus, it should be no surprise that there have been some incredible
number of FORTRAN and COBOL programs written.  Probably today someone
can claim BASIC has the most programs, but this doesn't mean anything
except that lots of home computers have been sold.

henry@utzoo.UUCP (Henry Spencer) (11/23/83)

Bill Price says (of Cobol):  "The fact of its continued use, as the most
popular of all programming languages, says a lot about it."

Yup.  Says that it's popular.  Period.  Not that it's good, or well-
designed, or pleasant to use, or cost-effective compared with the
alternatives.  Just popular.

(People who think popularity implies quality are invited to contemplate
the specs and sales figures for the VT100.  Or the 8080.)
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry