• Re: EQUAL TO in COBOL

    From J Leslie Turriff@jlturriff@mail.com to comp.lang.cobol on Tue Sep 25 00:50:03 2018
    From Newsgroup: comp.lang.cobol

    pete dashwood wrote:

    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    There are always a few pedants around who will go to the extreme,
    e.g. writing
    IF A IS EQUAL TO B THEN ...
    :-D
    --
    JLT
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Bill Gunshannon@bill.gunshannon@gmail.com to comp.lang.cobol on Tue Sep 25 09:45:35 2018
    From Newsgroup: comp.lang.cobol

    On 09/25/2018 01:50 AM, J Leslie Turriff wrote:
    pete dashwood wrote:

    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether
    something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error
    trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to
    something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this
    would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    There are always a few pedants around who will go to the extreme, e.g. writing
    IF A IS EQUAL TO B THEN ...
    :-D


    Some people continue to do that because it represents the
    paradigm that COBOL was designed with, that is, code that
    can be more easily read by humans as well as computers.

    As compared to the other popular language of the time which
    would have written: IF (A.EQ.B)

    And, today, space and the cpu time needed to parse the more
    verbose statements are pretty much meaningless.

    bill

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From docdwarf@docdwarf@panix.com () to comp.lang.cobol on Tue Sep 25 19:33:38 2018
    From Newsgroup: comp.lang.cobol

    In article <pociab$4l6$2@dont-email.me>,
    J Leslie Turriff <jlturriff@mail.com> wrote:
    pete dashwood wrote:

    [snip]

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    There are always a few pedants around who will go to the extreme,
    e.g. writing
    IF A IS EQUAL TO B THEN ...

    Now gather 'round, youngsters, and try to imagine a time where some very large, very influential companies would include, as a measure of
    productivity, a programmer's Number of Lines of Code Written per (unit
    time).

    DD
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From docdwarf@docdwarf@panix.com () to comp.lang.cobol on Tue Sep 25 19:51:31 2018
    From Newsgroup: comp.lang.cobol

    In article <g0usfvFbn1aU1@mid.individual.net>,
    Bill Gunshannon <bill.gunshannon@gmail.com> wrote:
    On 09/25/2018 01:50 AM, J Leslie Turriff wrote:
    pete dashwood wrote:

    [snip]

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    There are always a few pedants around who will go to the extreme, >> e.g. writing
    IF A IS EQUAL TO B THEN ...
    :-D


    Some people continue to do that because it represents the
    paradigm that COBOL was designed with, that is, code that
    can be more easily read by humans as well as computers.

    In some shops I've heard that used to justify Why We Do Things This Way - 'COBOL is supposed to be English-like and this is... Englishier than other ways so that's Why We Do Things This Way' - but after two, maybe three
    bouts of There's More Than One Way it becomes 'We Do Things This Way', if
    you want to see it pass Prod Review it needs... ' and that's it.

    DD
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From ime@ime@panix.com (Randy Hudson) to comp.lang.cobol on Tue Sep 25 22:16:20 2018
    From Newsgroup: comp.lang.cobol

    In article <g0usfvFbn1aU1@mid.individual.net>,
    Bill Gunshannon <bill.gunshannon@gmail.com> wrote:

    Some people continue to do that because it represents the
    paradigm that COBOL was designed with, that is, code that
    can be more easily read by humans as well as computers.

    As compared to the other popular language of the time which
    would have written: IF (A.EQ.B)

    That's FORTRAN IV. When Cobol was written, and for many years afterward,
    the main US alternative was FORTRAN II :

    IF (A-B) 202,204,202
    --- Synchronet 3.20a-Linux NewsLink 1.114