COBOL

From ArticleWorld


COBOL is a third-generation, business-oriented, object-oriented programming language. COBOL takes its name from an acronym (COmmon Business Oriented Language) and has a quite long history. Its latest specification is COBOL 2002, which adds a number of object-oriented facilities to the language.

Contents

History

The first COBOL set of specifications were created in 1959. It was designed by a committee specifically summoned to recommend a short-range approach to a common, easy to implement and use programming language. Six computer companies were involved: Burroughs Corp., IBM, Minneapolis-Honeywell, RCA, Sperry Rand and Sylvania Electric Products. The result was COBOL 60. Subsequent ANSI standards followed, as well as some non-ANSI standards (like the Unix COBOL X/Open and Microsoft COBOL).

These COBOL standards have done much to improve the original language, which was noted for its lack of some important features (like local variables, dynamic memory allocation, classic structured programming constructs and even recursion).

Distinctive features

COBOL's most distinctive feature are its verbose and English-like syntax and vocabulary. This has been a major source of sarcasm, but also seemed to make it easier for non-programmers to build COBOL programs.

The innitial specifications allowed COBOL to use self-modifying code very easily, an interesting feature for a high-level programming language, using an ALTER X TO PROCEED TO Y statement. However, this feature was dropped in later ANSI standards.

Controversy

The COBOL language itself is subject to quite a lot of controversy. On one hand, many experienced programmers blame it for its verbose syntax that makes programming even some simple expressions very crippled. On the other hand, a lot of legacy COBOL code still exists, and COBOL programmers are still quite demanded, thus proving that the language itself is still rather popular.

While not facing the same amount of criticism as BASIC, COBOL has its own share of problems when dealing with the many standards that add crucial features to others. It is therefore quite difficult to write a COBOL program that will run on any of the existing COBOL implementations without some major changes.

COBOL's verbose syntax and rather inflexible structure were the source of much humor among users of other, more concise programming language. C and FORTRAN users were particularly irritated with using COBOL.

Quick example

The canonical hello world is:

IDENTIFICATION DIVISION.
         Program-Id. Hello.
      *
       ENVIRONMENT DIVISION.
      *
       DATA DIVISION.
      *
       PROCEDURE DIVISION.
       Para1.
           DISPLAY "Hello, world.".
      *
           Stop Run.