Go to the first, previous, next, last section, table of contents.


2. COBOL Overview

2.1 Use of Material from the COBOL Standard

The following is reproduced from the COBOL Standard:

Acknowledgment

Any organization interested in reproducing the COBOL standard and specifications in whole or in part, using ideas from this document as the basis for an instruction manual or for any other purpose, is free to do so. However, all such organizations are requested to reproduce the following acknowledgment paragraphs in their entirety as part of the preface to any such publication:

COBOL is an industry language and is not the property of any company or group of companies, or of any organization or group of organizations. No warranty, expressed or implied, is made by any contributor or by the CODASYL COBOL Committee as to the accuracy and functioning of the programming system and language. Moreover, no responsibility is assumed by any contributor, or by the committee, in connection therewith.

The authors and copyright holders of the copyrighted materials used herein

  1. FLOW-MATIC (trademark of Sperry Rand Corporation),
  2. Programming for the UNIVAC (R) I and II, Data Automation Systems copyrighted 1958, 1959, by Sperry Rand Corporation;
  3. IBM Commercial Translator Form No. F28-8013, copyrighted 1959 by IBM;
  4. FACT, DSI 27A5260-2760, copyrighted 1960 by Minneapolis-Honeywell

have specifically authorized the use of this material, in whole or in part, in the COBOL specifications. Such authorization extends to the reproduction and use of COBOL specifications in programming manuals or similar publications.

2.2 Purpose of COBOL

COBOL was a significant advance in the history of computer science, because it opened up programming for many people who found assembler tedious or difficult or both, and FORTRAN, ALGOL, LISP and kindred languages generally unappealing. That is, people who were neither mathematicians nor computer scientists.

It is particularly focussed on the writing of business logic and rules and to this end has very good control over numerical calculations and the associated rounding, as is needed for financial calculations.

Here is a quote from one of the inventors of COBOL (Jean Sammet, quoted in "The Psychology of Computer Programmming" by Gerald M Weinberg):

"The users for who COBOL was designed were actually two subclasses of those people concerned with business data processing problems. One is the relatively inexperienced programmer for whom the naturalness of COBOL would be an asset, while the other type of user would be essentially anybody who had not written the program initially. In other words, the readibility of COBOL programs would provide documentation to all who might wish to examine the programs, including the supervisory or management personnel. Little attempt was made to cater for professional programmers."

In fact of course almost all COBOL code is written by professional programmers.

2.3 What's Good About COBOL?

  1. More people can write COBOL than C/++. There is more COBOL code than probably any other language.
  2. The language limits to some extent the trouble you can get yourself into.
  3. It has better support for decimal arithmetic than most other languages. You can achieve a precisely defined truncation or rounding result for your calculations, even with large values. This is important when money is involved.
  4. It runs well on mainframes, which usually have extended instruction sets to handle COBOL operations like decimal arithmetic.
  5. The syntax does not look like line noise (like PERL) or swahili (like Smalltalk or LISP). It is more self documenting. There is some evidence that its 'verbose' nature makes it easier to understand programs quickly.
  6. Lots of people know COBOL, and these people have a lot of knowledge about the businesses they work in, and how to put together large mission critical systems.
  7. COBOL is one of the most successful languages of all time. Probably in fact more money has been paid to people to write COBOL programs than any other language.
  8. Indeed there may be more COBOL code in existence than any other language. This means that much of the Intellectual Property of business is embedded in COBOL programs.

2.4 What's Bad About COBOL?

In fact COBOL breaks almost every conventional rule of programming languages design. Compare it to the criteria listed in "The Psychology of Computer Programming" -

  1. It is non-uniform. Handling of spaces is inconsistent. There are at least three different kinds of expressions allowed in different contexts. There are inconsistencies in the use of noise words like 'are' - sometimes they are required, sometimes is/are are substitutable, other times not. Large numbers of useful names are reserved words. It is hard to avoid clashing with reserved words.
  2. It is not compact, in two ways. It is by far the largest language in regular use. In addition, programs written in COBOL are generally 2-3 times larger than a corresponding program in C.
  3. It is not local and linear. All the variable names are up the top of the program, leading to the excessive use of global variables and other bad habits. Nested programs largely resolves this problem but many shops do not allow use of nested programs. There are heaps of reserved words, all over the place.
  4. It works poorly outside its preferred domain - coding business logic. For example many systems programming features such as logical operations, basic binary data items, pointers etc are missing from the (standard) language.

In the new draft standard (COBOL 2002) most things get better and one or two get worse (eg reserved word list).


Go to the first, previous, next, last section, table of contents.