Some systems never ever die—they just fade into the woodwork.
Talk to the regular software program developer about COBOL (Typical Small business Oriented Language) and they’ll look at you as if you mentioned carbon paper, leaded gasoline, or the seventy eight RPM document. In comparison to modern languages like Go or Python—or even Pascal or C!—COBOL seems wordy, clunky, passé.
But COBOL has endured. Far from an obsolescent technology we’ve happily parted enterprise with, COBOL has develop into an institution. Significant COBOL codebases are nevertheless in use all over the entire world, numerous of them jogging virtually exactly as they had been when initial produced. In Hollywood parlance, the COBOL language has “legs.”
So, sure, COBOL is nevertheless applicable and timely—painfully so, in reality. In modern months COBOL has re-entered the general public consciousness, as states like New Jersey have put out a call for programmers to support go their COBOL apps into the twenty first century.
In this piece we’ll look at COBOL’s origins, how the design of the programming language stands out even right now, and what would make COBOL each so enduring and so intractable.
COBOL arose in the late nineteen fifties and early 1960s. The progress of the language was a job sponsored by the United States Office of Protection (DoD) that incorporated a consortium of pc companies including IBM, Honeywell, Sperry Rand, and Burroughs. The aim was to generate a programming language with the pursuing characteristics:
- Portability involving pc systems, hence creating it simpler to migrate software program each throughout generations of hardware and involving hardware makers.
- A lot more English-like syntax than other languages of the time (e.g., FORTRAN) as a way to encourage programming by a broader audience, even if at the cost of some operational pace.
- The potential to accommodate potential adjustments to the language.
The initial formal COBOL specifications arrived out in 1960. Around the future decade, and to the consternation of its critics, COBOL became the default decision for composing business enterprise apps. A single explanation for its quickly spread was network consequences: IBM, one particular of the original collaborators on the language, became an intense early adopter, and IBM’s dominating existence in the computing entire world helped lead to COBOL adoption.
Thanks to its design strengths and heavyweight field backing, COBOL has stuck all over, outliving the original systems it was created for by a large margin. According to numerous estimates, by 1970 COBOL was the most broadly made use of programming language in the entire world. By 1997, COBOL was thought to be jogging some 80 per cent of business enterprise apps.
The designers of COBOL broke with the terse syntax of other programming languages at the time (all over again, this kind of as FORTRAN). The strategy was to generate a programming language that could be read and recognized by non-programmers, specifically accounting, finance, insurance policy, and other business enterprise specialists.
Look at a “hello world” program written in an early dialect of COBOL:
Plan-ID. Hi there-Entire world.
Display screen 'Hello Entire world!'.
For modern software program builders reared on the terseness of languages like Python, this code is verbose. But the verbosity of COBOL (if not its execution) springs from the exact same conceit that informs modern languages like Python — that code is read numerous additional times than it is written, so it should really be written to be readable.
A comparable program in a additional modern version of COBOL may well look a little something like this:
program-id. good day.
display "Hi there entire world!".
Although this instance is additional concise, the exact same simple rules utilize: The code strives to be explicit about what’s likely on at each individual stage.
COBOL has strict principles regarding syntax and the internal group of packages. A COBOL program is explicitly divided into sections, or divisions, that make it simpler to identify and comprehend its factors at a look:
- Identification division: Primarily a metadata part, containing details about the program, its writer, and so on.
- Natural environment division: Consists of details about the runtime surroundings, for instance aliases for exterior gadgets, which may well need to have modifying when jogging the program on various hardware. This aided portability of a program involving systems, exactly where for instance I/O may well be handled totally differently.
- Details division: Containing file and doing work storage sections, the Details division describes the files and variables (respectively) made use of in the program.
- Process division: The genuine program code lives in this article, damaged into rational models named sections, paragraphs, sentences, and statements. It is tempting to analogize these structures to modules or capabilities, because they serve roughly the exact same capabilities (dividing code into blocks, with constrained inputs and outputs) but they are much much less versatile.
COBOL also has incredibly strict formatting principles for the code, down to the range of areas previous a command. (Python end users will locate this familiar!) Some of these limitations are a by-solution of COBOL’s coming-of-age all through the mainframe period of the 1960s, when packages had been encoded on punched cards and the exact formatting of 80-column strains mattered. But other formatting limitations implement readability.
The strategy behind the strict regimentation of COBOL packages is to make them as self-documenting as possible. After all, COBOL packages tended to continue to be in location for several years or decades on conclude. The intent (if not normally the conclude outcome) was to make each and every COBOL program an artifact that any COBOL programmer could comprehend, even several years later on, without the support of the programmer who produced it.
Considerably of COBOL’s continued prevalence—and inertia—comes from the reality that COBOL apps, at the time written, tended to be remaining in location indefinitely, with only minor modifications. The greater and additional mission-important the application, the much less very likely it was to be disturbed. Mainframes, like IBM’s offerings, played a crucial position: They had been developed to be very backward compatible and to run legacy software—like COBOL apps—across generations of hardware with minimal modifications. The outcome: Billions of strains of COBOL code jogging essentially unchanged for decades on conclude.
Around the several years, COBOL has progressed, if bit by bit. It even now has an item-oriented variant, OO-COBOL, which includes support for modern features like Unicode, locales, and additional state-of-the-art info sorts outside of strings and integers. But COBOL aggressively retains backward compatibility, so even these improvements and extensions adhere to the mandate that existing COBOL apps ought to continue on to run.
Not all of COBOL’s language design decisions have been well-known with COBOL programmers. Some have led to overly complicated packages that proved tricky to comprehend or debug, discouraging rewrites or improvements. COBOL’s
GO TO command, like its counterpart in C, allowed programmers to jump freely all over a program, and hence write additional strong apps. But undisciplined use of
GO TO could convert a COBOL program into a rat’s nest of really hard-to-trace cross-references.
COBOL programming right now
COBOL survives right now in a handful of incarnations. IBM actively maintains its own COBOL implementations and sustains numerous existing COBOL apps exactly where they run. Micro Focus COBOL is a business COBOL edition that operates on Microsoft Home windows, compiles COBOL apps to Java and .Internet, and even deploys to cloud environments like Azure. You will also locate open supply implementations of COBOL, this kind of as GnuCOBOL, which are freely accessible and compile to native device code. On the other hand, they may well lack some of the additional state-of-the-art deployment or debugging features of the business COBOLs.
Although COBOL remains in large use, deep COBOL skills is turning out to be more difficult to arrive by with each individual passing year. As a outcome, numerous former COBOL programmers have to be coaxed out of retirement to wangle older apps into the twenty first century. Typically, it isn’t COBOL programming awareness that’s most at a top quality, but intimate understanding of the mainframe environments exactly where COBOL operates. Lots of COBOL apps do the job hand-in-hand with legacy technology this kind of as IBM’s IMS and CICS transaction management and databases systems, all of which demand skills that is ever more exceptional.
Hence, as aged-university as COBOL may well seem to be, the need to have for COBOL language and progress-surroundings skills has grown with each individual passing year. Job listings for COBOL and related skills abound. In March 2020, New Jersey put out an crisis call for COBOL programmers to support improve state unemployment positive aspects systems in the wake of the COVID-19 crunch.
Discovering sources for COBOL are proliferating all over again, given the rising desire for the language. Modern day builders who want to get up to pace with this most enduring of languages have a handful of solutions:
- The College of Limerick, in Ireland, provides a comprehensive COBOL programming class on the net, courtesy of its Office of Computer Science and Information and facts Methods. It is not as up-to-date as some other sources, but given how small COBOL adjustments with time, that’s not essentially a defect.
- The Open up Mainframe Project also provides COBOL sources. A single is a total class in COBOL programming, co-sponsored by IBM. It is additional modern than the College of Limerick class, and customized to IBM’s zOS implementation of COBOL, which is a broadly deployed version of the language.
COBOL has been a staple of business enterprise computing for decades, and the desire for COBOL programming talent only continues to develop. If protecting or modernizing COBOL packages interests you, the time seems riper than ever to dive in.
Copyright © 2020 IDG Communications, Inc.