[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] Best online and text tutorials?
From: |
Brian Tiffin |
Subject: |
Re: [open-cobol-list] Best online and text tutorials? |
Date: |
Mon, 11 Aug 2008 13:03:51 -0400 |
User-agent: |
KMail/1.9.9 |
Well spoken John. I'll agree as well. The short hello was an exercise in
possibilities, not good form or professionalism. That sample is highlighting
OpenCOBOL's robost and wide coverage, more than good practise. And, when it
unveils soon, you will see the Hello World that occurs in most of the FAQ is
more inline with historically easy to read COBOL (and even includes sequence
numbers).
000100* HELLO.COB OpenCOBOL FAQ example
000200 IDENTIFICATION DIVISION.
000300 PROGRAM-ID. hello.
000400 PROCEDURE DIVISION.
000500 DISPLAY "Hello World!".
000600 STOP RUN.
The exercise was partly the result of a thread on the forum caused in response
to a very misleading technology "architect"'s blog entry and a comment about
not being able to count the number of lines in a Hello World program.
http://duckdown.blogspot.com/2008/06/mainframe-is-not-evil-but-cobol-is.html
The one comment that really got me was the subtle linkage of COBOL and buffer
overflow security attacks. Arrgghh! Some people's kids ... :)
Cheers,
Brian
On August 11, 2008 08:25:44 am John Culleton wrote:
> On Saturday 09 August 2008 11:34:30 am Brian Tiffin wrote:
> > On August 9, 2008 12:57:52 am address@hidden
>
> wrote:
> > > I would state that a simple Hello World Program in COBOL
> > > has become MUCH simpler than his example. We no long
> > > are required to have all those sections or even the preceding
> > > line numbers.
> >
> > Yeah, on the opencobol.org forum (and in the soon to be unveiled
> > FAQ), hello world is as short as
> >
> > program-id.hello.procedure division.display "Hello World!".
> >
> > Cheers,
> > Brian
>
> There was a language in my youth called APL whose fan base reveled in
> creating one line programs. I hope COBOL and its fan base has not
> been reduced to that level. An important and unique feature of COBOL
> is that it was designed to be read as well as written. It is
> intended to be a self-documenting language. While recent versions
> have strayed far from that original concept the thought of reducing a
> sample program to one line is a violation of one of the key features
> that makes COBOL different from other languages. Just because you can
> do it doesn't mean you should do it.
>
> Another key feature of COBOL is that it is a file handling language.
> Hence my template includes the major headers required for file
> handling.
>
> The use of line numbers is a matter of personal taste. As an old time
> COBOL dude I prefer them. Ditto upper case versus lower case. But
> many compilers will choke on a program that lacks all four divisions.
> Hence an example program that omits them is IMO a misleading one.
>
> I would at a minimum rearrange the one-liner thus:
>
> identification division.
> program-id. hello.
> procedure division.
> display "Hello World!".
> stop run.
>
> IMO of course.
>
> ---------------------------------------------------------------------------
> John Culleton
>
> -------------------------------------------------------------------------