FLOW-MATIC, COBOL's Roots

FLOW-MATIC was a programming language designed around Hopper's observation that "very few [people involved in data processing] were symbol oriented; very few of them were mathematically trained." (16, Wexelblat) In response, Hopper and a team of programmers isolated a list of about 30 verbs that described what data processors did in the code they wrote. They worked to develop a way of coding such that the code could be written in any language and be easily understood by the business community.

When proposing the idea of FLOW-MATIC, Hopper encountered some resistance. After all, "it couldn't be done because computers can't understand English!" The FLOW-MATIC project, at the time of its development, required the largest budget Hopper had ever asked for, so she decided that she needed to dazzle the management. She took the sample English code and wrote it in French and German as well! (From Wexelblat, 17)

 

The Birth of COBOL

The impetus for COBOL in 1959 came from the proliferation of data-processing business languages by several manufacturers. The United States military felt that something should be done to direct the development of a standard languages so a panel of 7 government representatives, 11 users and consultants, and 10 computer manufacturer representatives met to discuss the problem. From the beginning, it was assumed that a English-like business oriented language would be designed.

Goals for COBOL

The committee set criteria for COBOL. One requirement of great importance was naturalness - that it could be read naturally. Also, programs needed to be easily transcribable for different forms of media. This meant, for instance, that the program had to be expressible using the keypunch character set and "not 128 characters that nobody had" (Wexelblat, p249). The problem structure had to effective for the problems faced in data-processing environments, and the compiler had to be feasible to implement.

Language Features

Modularity

COBOL programs consist of four divisions:

These divisions COBOL programs extremely portable. To move a program to a different system, only the Environment division must be swapped. The rest of the code can stay as it is.

One tradeoff COBOL developers encountered was between efficient and independent data descriptions. If the interchange of environment files was sufficient to move a program to another platform, then certain data structures would be more efficient on certain platforms than they would on other platforms. However, constraining programmers to efficient data structures hampers portability and introduces coding complexity. COBOL developers chose to make the programmer's life easier.

Sample of COBOL Environment Division Code

ENVIRONMENT DIVISION
CONFIGURATOIN SECTION
OBJECT-COMPUTER. IBM 705.
INPUT-OUTPUT SECTION.
FILE-CONTROL. SELECT INPUT-FILE-1
   ASSIGN TO TAPE 5.
   SELECT FILE-2 ASSIGN TAPE 6.

Sample of COBOL Data Division Code

DATA DIVISION
FILE SECTION
FD INPUT-FILE-1; RECORDING MODE IS F;
BLOCK CONTAINS 5 RECORDS;
LABEL RECORDS ARE STANDARD;
DATA RECORD IS INPUT-RECORD.

Source: Wexelblat, p.245

Conditionals and Implied Objects

COBOL was unique in that its conditional statements understood implied objects, the way that humans understand it in spoken language. This is in direct contrast to most programming languages, which require specific, unambiguous conditional statements. Such constructions contributed to the natural feel of the language syntax.

COBOL Conditional Statements

IF X=Y MOVE A TO B;
IF GREATER ADD A TO Z;
OTHERWISE MOVE C TO D.

C Conditional Statements

if (X == Y) ...;
if (X > Y) ...;
if (X < Y) ...;
Code from Wexelblat, p.230.

Operators

During COBOL's development, one debate was whether to use verbal math operators (ADD, SUBTRACT, MULTIPLY, DIVIDE) or symbolic operators (+, -, x, /). While some argued that business people wouldn't want to deal with the level of complexity implied by symbols, others argued that those who could handle symbols shouldn't be impeded from using them. In a compromise, COBOL allowed for both forms.

Readability

COBOL included a few verbs with many options. The statements were all in imperative form, and constrained to the physically available character set. Noise words were allowed, introducing extra complexity for the compiler writers. Also, long data names were allowed.

Deliberate Exclusions

Because the business community primarily dealt with fixed precision dollars and sense, floating point was deemed unnecessary in COBOL. Also, functions were excluded because they were too tied to the mathematical idea of functions.

Standardization

In user for over 20 years, COBOL was very close to being a standardized language. COBOL was the first language that had a set of validation routines to test compiler output for consistency. In fact, COBOL became a de facto standard because the computer industry's most important client at the time, the U.S. military, demanded systems equipped with COBOL.

Importance of COBOL

COBOL continued to be in use for over 20 years. The language's most famous resurgence came with the struggle to fix the Y2K bug in many old systems before the change of the millennium!

Additionally, it set a high-bar for program readability and orderly language maintenance and enhancement. It also showed the possibilities of successful collaboration between different manufacturers.

 

Bibliography

Norman, Rebecca. (January 2001). Grace Murray Hopper. Available: http://www.agnesscott.edu/lriddle/women/hopper.htm. Date of Access: 25/06/01

Sammet, Jean (1981). The Early History of COBOL. In Richard L. Wexelblat (Ed.), History of Programming Languages (25-74). Academic Press: New York.