Thursday 11 September 2014

COBOL Poetry

 IDENTIFICATION DIVISION.
 PROGRAM-ID. POETRY.
*
***********************************************************************
* THIS IS WHAT HAPPENS WHEN I READ ABOUT PEOPLE WRITING POEMS IN PERL *
* AND THE ARTICLE SUGGESTS NO ONE WOULD EVER WRITE ONE IN COBOL       *
*            CHALLENGE ACCEPTED!                                      *
***********************************************************************
*
 ENVIRONMENT DIVISION.
*
 DATA DIVISION.
 WORKING-STORAGE SECTION.
*
 01 WONDER-IF-YOU-LOVE-ME  PIC X(1).
      88 YOU-LOVE-ME         VALUE 'Y'.
      88 YOU-LOVE-ME-NOT     VALUE 'N'.
*
 01 MY-BEST-SIDE  PIC X(40) 
                  VALUE 'ALL NEUROSES HIDDEN SO YOU WILL LOVE ME.'.
*
 PROCEDURE DIVISION.
*
 HOW-TO-MAKE-YOU-LOVE-ME.
*
     IF YOU-LOVE-ME
        CONTINUE
     ELSE
        PERFORM TO-WIN-YOUR-LOVE
     END-IF
*
     GOBACK.
*
 TO-WIN-YOUR-LOVE.
*
     PERFORM UNTIL YOU-LOVE-ME
        DISPLAY MY-BEST-SIDE
     END-PERFORM
*
     EXIT.
*

5 comments:

  1. Fabulous! I don't even know COBOL and I can see it's awesome. (:

    ReplyDelete
    Replies
    1. COBOL was one of the first, if not *the* first, programming languages to be written in proper English, making it a lot easier for non-coders to follow. All thanks to a marvellous lady named Grace Hopper (also known as The Mother of COBOL), who suggested that it might be a good idea.

      Delete
    2. That gives me a thought. If we're talking about English-like languages, what about a very simple, brief playable IF in Inform 7, that reads as beautifully as it plays?

      See this white opera glove? This one here? No, don't ask what I'm doing with it. Look:

      *throws opera glove to floor*

      I have no idea if it's possible, but I hereby challenge you. We'll come back in a week and compare. And if they are suitably awesome, we should collaborate on making them awesomer.

      Delete
    3. Oh, dear God, there's an idea...

      It. Is. On.

      Delete
  2. I am so happy that you did this! And it is so snarky and true! :)

    And I am terribly honoured to have been indirectly involved in bringing more programmer poetry in the world!

    ReplyDelete