Live data from Hacker News

A Historical Perspective on COBOL (2020)

logicmag.io

21–30 of 39 posts

Re: A Historical Perspective on COBOL (2020)

#21
COBOL was my first professional programming language.

We wrote the code with a pencil, on coding sheets. The team leader checked it, and once it was deemed OK, we could type it in on a terminal.

It was a horrible language. The article speaks of code that "reads like a novel"; I swear I never read COBOL code that was easy to read. The problem was that COBOL doesn't lend itself to expressing structure. Combined with the fact that we were under commercial pressure to ship code, we shipped a lot of spaghetti code.

The idea that COBOL code is "easy to maintain" is nonsense. Any non-trivial COBOL program that is easy to read and maintain is going to be harder to write than an equivalent program in (say) Pascal, PL1 or ALGOL.

I worked for Burroughs; one of the super-powers of the Burroughs systems was hardware BCD arithmetic. It allowed a COBOL programmer to declare numeric variables with any specified number of decimal digits, and perform arithmetic on them with exact precision, easily. This is necessary when handling currencies, for example. Also, a hex dump of a BCD variable is precisely it's decimal value - BCD made it easy to debug.

It is said that COBOL is unsuited to systems programming. This is true; but it's not impossible. I was lucky enough to be sent on an "advanced COBOL course", in which I learned that the Burroughs COBOL compiler had seven passes; and that you could stop it during the later passes, and edit the intermediate code, before resuming the remaining passes. This meant that you could do things like access registers and IO ports. It blew my mind (but I never made use of those learnings!)

For many years, I denied that I had ever learned COBOL, for fear of being marked-down as an old fogey. Now I'm retired, I am an old fogey, and I don't give a tinker's cuss.

Re: A Historical Perspective on COBOL (2020)

#22
post #2

(I work in mainframes, but not directly COBOL.) COBOL could certainly be done better today, but its strength comes from the fact that it limits what programmers can do with it. In the past, there was a divide between systems and application programmers. Roughly, the systems programmers took care about the details of the infrastructure and resource access, while the application programmers worried about the "business…

Cloud is the new mainframe. The split between infrastructure (platform) and application engineers is back.

Re: A Historical Perspective on COBOL (2020)

#23

COBOL was my first professional programming language. We wrote the code with a pencil, on coding sheets. The team leader checked it, and once it was deemed OK, we could type it in on a terminal. It was a horrible language. The article speaks of code that "reads like a novel"; I swear I never read COBOL code that was easy to read. The problem was that COBOL doesn't lend itself to expressing structure. Combined with th…

IBM mainframes also do/did hardware BCD arithmetic, starting with System/360.

And as for COBOL not lending itself to structure, how did Structured COBOL exist, then? I wrote lots of COBOL without a single GO TO anywhere in the code.

Re: A Historical Perspective on COBOL (2020)

#24
post #4
post #2

(I work in mainframes, but not directly COBOL.) COBOL could certainly be done better today, but its strength comes from the fact that it limits what programmers can do with it. In the past, there was a divide between systems and application programmers. Roughly, the systems programmers took care about the details of the infrastructure and resource access, while the application programmers worried about the "business…

> In the past, there was a divide between systems and application programmers. Roughly, the systems programmers took care about the details of the infrastructure and resource access, while the application programmers worried about the "business logic" of the applications. I would add that in the era cobol was designed and rose to prominence, assembler was used for both. Cobol enshrined the application assembler pract…

We used PERFORM to implement calls. Whether or not implemented with a stack, it acts the same as any call/return. So to implement a simple loop to count records in a file:

PERFORM COUNT-ROWS VARYING COUNT FROM 1 BY 1 UNTIL EOF.

And the callee did:

READ INPUT-FILE AT END MOVE 1 TO EOF-FLAG.

Re: A Historical Perspective on COBOL (2020)

#25
I haven't written a Cobol program since the 1980s, and I am hopeful I never will. Still, Cobol had many significant advances.

1. It popularized the notion of program portability, in that a Cobol program was expected to run, nearly unchanged, on any machine with a Cobol compiler.

2. It popularized the notion of data portability, in that DISPLAY data (though not COMPUTATIONAL data) should be the same, and produce the same results, on machines of disparate architectures.

3. It popularized record data types.

4. It emphasized the idea of program readability, even though we would now (I hope) reject “pseudo-English” as a solution.

The fact that it fell (far!) short of these ideals should not blind us to Cobol's significant contribution to programming languages.

Re: A Historical Perspective on COBOL (2020)

#26
At least a dozen state unemployment systems still run on this sixty-one-year-old language, including ones that help administer funds of a billion dollars or more in California, Colorado, and New Jersey. When the deluge of unemployment claims hit, the havoc it seemed to wreak on COBOL systems was so widespread that many states apparently didn’t have enough programmers to repair the damage; the governor of New Jersey even publicly pleaded for the help of volunteers who knew the language.

Re: A Historical Perspective on COBOL (2020)

#28
post #20
post #12

Article acts like having a 'richer' language approximating English makes it easier or more approachable, but whenever I've tried such languages I've found them harder. A programming language with simple and more orthogonal syntax like C is much easier to learn and reason about, than a language where you learn so many different verbs/constructs like COBOL or Ada. And I think that -- depending on the problem -- you wan…

> Article acts like having a 'richer' language approximating English makes it easier or more approachable, but whenever I've tried such languages I've found them harder. You're not the target audience. Grace Hopper explained it: “I used to be a mathematics professor. At that time I found there were a certain number of students who could not learn mathematics. I then was charged with the job of making it easy for busi…

Very interesting, and I have a lot of respect for Grace Hopper personally. I think tech that's meant to look 'correct' to the right people is often worse off for it, though. I've got no interest in appealing to the people that won't even bother trying to look at it if it reminds them of maths or uses something other than plain English, but it has a place I suppose. I just think the posted article overestimates its scope.

Re: A Historical Perspective on COBOL (2020)

#29
post #18
post #12

Article acts like having a 'richer' language approximating English makes it easier or more approachable, but whenever I've tried such languages I've found them harder. A programming language with simple and more orthogonal syntax like C is much easier to learn and reason about, than a language where you learn so many different verbs/constructs like COBOL or Ada. And I think that -- depending on the problem -- you wan…

What do you think about SQL?

I have a low opinion of it! And I'm not in a tiny minority there. There have been other query languages that seemed better to me, but SQL won. SQL's not nearly as wordy as COBOL though, if you want to calculate tax in SQL you're going to write a formula. I think there's a time and place for different styles of languages, for a general purpose (or even business-oriented) language I think it should have a relatively simple and succinct syntax. I just think a programming language that's more consistent and mechanical is easier for most people to grok, and I know a ton of programmers that like to tell everyone that they "sucked at maths, you don't need to be good at maths to program", the syntax didn't put them off.

Re: A Historical Perspective on COBOL (2020)

#30
post #7

Earlier quoted context omitted.

Actually I think this divide still exists, just at another level. For example when I write Java code, I don't care if the VM is implemented in C, C++, Assembly, hardware or whatever. Just like when I upload the jar file into a cloud instance app engine, usually I don't care if the JVM is running on top of some OS, bare metal or whatever it making it run. Yet, there is a group of developers that is making that illusio…

But you have to care about FileInputStreams, bytes and CompletableFutures. The "best" we have to offer today as "pure" business logic programing is some BPMN framework/platform.. and that is mostly hell of Earth.. COBOL is not coming back because that time has passed, however something with the basic essence and principals of COBOL is desperately needed. Don't ask me what and how because I don't know either.

> The "best" we have to offer today as "pure" business logic programing is some BPMN framework/platform.. and that is mostly hell of Earth..

Do cloud plateforms fall under BPMN frameworks/plateforms? From what I understand, it's possible to build applications today using cloud plateforms (AWS and Azure mostly, I don't know about the others) for auth, persistance, etc; while only writing your business logic, especially now with serverless where you only write functions.

In a way this is the return of the distinction between application and system, but the system is left to another company. This would fit with the (anecdotal) pattern I've noticed where before companies had cleaning people, IT people, etc and now everything is subcontracted to other companies.

Post reply on HN