# Why is Cobol so popular?

#### new6ton

Gold Member
Why is cobol use still widespread?

Is BASIC still used?

Related Programming and Computer Science News on Phys.org

#### jedishrfu

Mentor
I’m sure they both are still in use. A lot of business software still running today runs on COBOL because why change it if it works. In the case of BASIC, I’m sure there are many small apps running around that folks still use or some dedicated server running a BASIC program where once again if it isn’t broke no need to fix it.

Look at all the old Windows, OS/2 and PC-DOS machines still running various dedicated operations. Each of those is capable of running BASIC

I am reminded of the MORTGAGE calculator I would hunt for to estimate my payment options given some interest rate. It was often faster than logging on and searching for an online calculator that would milk your data and try to upsell you some new kind of loan.

#### Klystron

Gold Member
Why is cobol use still widespread?

Is BASIC still used?
COBOL provided the front end to early databases among many other business apps. Businesses need the old data and COBOL apps to process it. C and UNIX by comparison were used in more innovative environments; universities, laboratories, research centers and technology companies. COBOL might still have been used in the business/accounting areas of those places. That COBOL persists as an active language demonstrates the innate conservatism of Business.

As @jedishrfu posted, an axiom at COBOL shops was, "If it ain't broke, don't fix it."

BASIC was intended to teach basic programming skills and concepts to beginners not provide sophisticated data structures in multi-threaded code. Other teaching languages such as Pascal and smalltalk were useful in classrooms but had limited commercial application.

#### Dr.D

I have used BASIC for about 35 years now, and still continue to do so in my engineering consulting and research. It is the fastest, simplest way to get to a correct numerical answer. Rarely ever do I have to worry about computational speed in my work, so that is simply not an issue for me. I used True BASIC, the second effort from John Kemmeny and Tom Kurtz, and it is fast enough, simple enough, and just a delight to use. It incorporates a full set of matrix operations, so I can formulate my problems in matrix form if that is convenient, and then write the code directly in that form. It gives at least 14 digit accuracy in all operations, about runs on both my Win 10 and Win XP machines. I prefer the DOS based version for code development, but the graphics are better on the Windows versions, so I use both the same code interchangably on both. I've used this for teaching, consulting, industrial work, and work for the US Navy. It suits my needs quite nicely.

#### HankDorsett

Gold Member
Here's an example of why COBOL and other legacy programming languages on mainframes are still around.

I work for a Fortune 500 company in the early 2000s that ran their business on a Mainframe. They spent over 20 million dollars to get off the Mainframe but failed. They were unable to duplicate a critical feature in accounts receivable on an open systems platform. During the mid-2000s open systems hardware wasn't able to provide enough CPU power to process what was needed.

Bit of detail on the issue.
One of their largest customers was the US government. At that time it was common for the US government to send in a payment for multiple invoices without telling you what invoices they are paying. The AP application on the Mainframe was able to determine what invoices they were paying based off of the amount.

#### .Scott

Homework Helper
COBOL was one of the very first computer languages that was supported across a wide variety of hardware. In fact, it was specified by the US DoD for exactly that purpose. For quite some time, it was the most popular programming language - more popular that the older FORTRAN. Programmers often identified themselves as either "COBOL Programmers" or "FORTRAN programmers". With the FORTRAN programmers being more likely adept at assembler and machine language. I considered myself a FORTRAN programmer, although I coded an application in COBOL before doing anything useful with FORTRAN.

One of the notions behind COBOL was that it was self-documenting. Certainly a manager could pick it up, read it, and get something from it.

To answer your question directly, there's still a lot of COBOL code out there that needs to be either replaced or maintained. Since most of that huge army of COBOL programmers have retired (Yours Truly excepted), there is some drive towards replacing COBOL code rather than maintaining it.

I have been surprised at how long code stays in place. Fifteen years into my career I surveyed all of the places where I had coded to get a status report and perhaps potential follow-on work. To my astonishment, every bit of my code that was in use when I left was still in use then.

My first two professional software projects were in 1971. One involved scheduling classes for 4000+ students at my high school. The other was a COBOL program for doing election night projections and reporting. I know that scheduling work still serves as a template for the class schedule to this day. But I dearly hope they have long replaced that election night system.

#### anorlunda

Mentor
Gold Member
Part of the reason is that organizations tend to create onion skin structures when updating/expanding code. Rather than re-write the original code, they wrap it in a skin that changes the external behavior. Later comes another skin and another.

That is a particular problem in cases where the code must be certified and licensed by government. A change to the original code means that the whole thing needs to be re-licensed, but adding a skin means that only the skin needs a supplemental license. The second is much faster and cheaper. The skin can be written in a different programming language.

When it came to Y2K, that strategy caused a lot of grief. The cores of some onions was 40-50 years old. No employees from that era still worked. In some cases, nobody remembered how the code at the core of the onion worked, or even what the function of the core code was. It is possible for skins to take on the entire functionality leaving a legacy of dead code in the middle; but nobody can be certain that it's dead.

Y2K motivated a lot of companies to finally retire the whole onion and replace it with modern code. In that respect, Y2K was a huge benefit to us. When 911 happened 20 months later, the off-site emergency backup centers of many WTC companies took over almost flawlessly. If 911 had happened before Y2K, the consequences might have been very different.

#### hmmm27

<tldr;> COBOL is crazy efficient, from both machine and business points of view. BASIC was (originally) for newbies. Note that both are acronyms.</tldr>

COBOL was specifically developed to handle the kinds of data-processing relevant to business and record-keeping practices that have been developed over the last five or six millenia. Those haven't changed much, so why bother switching to a new language.

To remain current with the continued advances in computerized information systems, the language standard has been added to.

Unfortunately, some functionality has been deprecated :

The ALTER statement is mostly famous for being the bogeyman/stalking-horse of the 1970's push towards "structured programming" (a misnomer : what was actually being enforced was single-in, single-out modularity). It was deprecated in 1985, and removed from the standard in 2002.

Binary coded "packed" decimal, which implementation is one of the language's extremely strong points, is very poorly supported in microcomputer processor architectures more concerned with - somewhat ironically - dancing paperclips. (This, of course applies to all languages, but decimal representation is most important in business applications.)

But, despite derision - mostly voiced by programmers lamenting their aching fingers from coding in 'longhand' - it's still a very relevant language.

BASIC ? originally a very rudimentary interpreter language designed to give early-PC adopters and enthusiasts the ability to produce rudimentary programs, no other languages - except assembly - being available for the platform at the time. It's grown up, somewhat.

Last edited:

#### jedishrfu

Mentor
Boy you can really date folks here.

BASIC was around years before the PC. I originally saw it on the GE Timesharing Service around 1967 when I first got interested in computers. My uncle had a teletype machine in his home and could dialup the mainframe GE635 computer.

The two games I remember were TicTacToe and Gunner IV which I think were written in BASIC.

With respect to COBOL I remember it as cumbersome to write and that you would have a template for most of your code changing only the procedural and data division stuff. If you missed a period youd get many many errors as the compiler easily got out of sync.

The good news was that COBOL would process files of data more efficiently than Fortran because COBOL would only do ascii/bcd number conversions or work with packed decimal numbers when you needed to compute something whereas Fortran would convert every number when read in to integer or floating pt whether you used it or not irregardless.

The funny money our site used to charge other depts for computer time would charge $50 a run for a Fortran pgm vs$5 for the equivalent COBOL run and looking at CPU time was the key difference.

COBOL also had a certain flexibility for casual users. I once wrote a program for asset portfolio analysis. The user wanted to be able to change his analysis from time to time so I wrote a collection of PERFORM routines that he could mix and match to get his results.

He was very happy as no one had ever done it that way before giving him the freedom to muck with the code. COBOL could be very readable if done right ie self documenting.

A related story of old tech never dying at GE was the GE225, a single program computer that primarily ran one program that handled stock certificates. It was deemed too important to retire and even they tried to migrate off it via a hardware simulator. It never could quite replace the hardware and so the old computer remained tucked in a corner of our processing floor too fragile to move or to power down.

They were still using it until 1984 when i left GE for other challenges.

#### anorlunda

Mentor
Gold Member
Visual Basic (VB) became pretty mature. It had modules, classes, objects, exception handling, all the structured constructs, plus interpreted and compiled optimized executables. It would have been hard to reverse engineer one of those executables to determine if the source language was Basic or C++.

It turned out that the integrated development environment (IDE) of VB was more important than the basement level reputation of Basic, so Microsoft morphed it into Visual Studio, and added C# to the mix as another language. I'm sure some people will disagree, but today's Visual Studio owes more to the Basic world (i.e. the rich IDE) than it does to the C world.

#### Dr.D

Boy you can really date folks here.

BASIC was around years before the PC. I originally saw it on the GE Timesharing Service around 1967 when I first got interested in computers.
I'm sure you have heard the saying, "IF it ain't broke, don't fix it." Contrary to popular opinion, there is nothing wrong or bad about being old. I'm glad that I don't have to fight the career battles any more. The end is in sight!

#### anorlunda

Mentor
Gold Member
Contrary to popular opinion, there is nothing wrong or bad about being old.
No worry. You're far from the oldest one here. Elders of the community has a nice ring to it.

#### jedishrfu

Mentor
Or oldsters as the case may be.

#### jedishrfu

Mentor
I admit it @anorlunda is a few days older.

Okay okay may more than few days.

#### rcgldr

Homework Helper
COBOL provided the front end to early databases
In the case of IBM mainframes (360, 370, ...), the front end to early databases was assembly macros (such as support for ISAM (indexed sequential access method)). Since this forced the combination of using both COBOL and assembly, the programmers started to use assembly to improve performance in addition to the front end macros for databases. Now there is a legacy of a mix of COBOL and assembly, and as posted, why risk trying to port thousands of lines of working code that can still run on current IBM mainframes as they support legacy modes in z/OS or z/VM.

#### Baluncore

Is BASIC still used?
I still use the FreeBasic compiler which has all the benefits of C, structured data and links to all the exact same libraries. It is the quickest way to solve most numerical problems.
FreeBasic originated as a QuickBasic replacement for gamers, but has taken a couple of generational steps, so now it parallels Visual Basic with access to all C libraries.
FORTRAN code links or translates easily into FB.
With the -QB switch it will still compile legacy QB code.
FB is free, open source and comes with an IDE.
https://en.wikipedia.org/wiki/FreeBASIC

#### jedishrfu

Mentor
Latest on COBOL as it turns 60 this month:

#### hmmm27

FORTRAN's introduction preceded COBOL's by a few years. Notwithstanding FLOW-MATIC which influenced its design. Why don't article writers even check Wikipedia ?

"Why is Cobol so popular?"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving