News for hackers. Stuff that matters.
Re:Ask HN: How do I learn real-world COBOL? by jhugo on Tuesday June 28, 2022 @09:37AM (#31907504)
You think that those people are getting paid the big bucks because they know COBOL, but the reality is that they are getting paid the big bucks because they have decades of experience with all the legacy systems that surround that COBOL.

Learning COBOL, even in a "real" environment, isn't going to be the jumpstart that you're hoping for by itself.

Re:Ask HN: How do I learn real-world COBOL? by Stampo00 on Tuesday June 28, 2022 @10:49AM (#31908420)
The old pros are continuing to age out and retire or die. Places with COBOL systems want to keep their applications limping along instead of replacing them. The shortage of devs is only going to get worse. Remember when lock down started and some government systems built on COBOL started straining under the load? Rather than being dismissive, I'd encourage those with any interest at all to try to pick it up. We need folks to maintain it.
Re:Ask HN: How do I learn real-world COBOL? by thr0wawayf00 on Tuesday June 28, 2022 @12:55PM (#31910152)
> We need folks to maintain it.

Beware, maintaining those systems is absolute hell and the companies experiencing exodus are working their people into the ground because the workload is crushing them and they can't find replacements.

A good friend of mine is an engineering director at a company that runs a massive COBOL mainframe platform and he always half jokes with me about picking it up. The money isn't that great at his company and the problems they have maintaining the system just blow my mind. The entire company sounds fundamentally unsustainable long term but they're running critical payments infrastructure.

Re:Ask HN: How do I learn real-world COBOL? by masukomi on Tuesday June 28, 2022 @01:26PM (#31910495)
as an outsider (and thus potentially ignorant of pitfalls): I'm a big fan of the strategy to add transpilers to modern languages so that we can start writing new code in them, have them output COBOL, and then eventually have enough of the codebase written in the new lang to swap over to it instead.

I'm thinking of the Elixir->COBOL like this: https://github.com/TheFirstAvenger/cobol_to_elixir

Was speaking with the author about a year ago and he was having really good success with it.

Re:Ask HN: How do I learn real-world COBOL? by karmakaze on Tuesday June 28, 2022 @06:31PM (#31913935)
The example link goes COBOL->Elixir.

I like this idea of writing Elixir and outputting COBOL. That way it can interface with the operating environment (CICS, IMS) exactly as a natively written COBOL program does. Not that COBOL syntax is particularly hard to learn one by one, but as a whole isn't very memorable. Why learn a programming language with peculiarities like a natural language when I can use something concise that translates to it? There may not need to be a step to eliminate the COBOL output step any more than a language that uses C or js as a target.

I've only seen two kinds of CICS programs in the wild: 1. screen I/O using preformatted BMS maps, 2. transactional with input buffer and output buffer. A third kind was one I wrote for sending dynamically generated terminal stream data for a hypertext online documentation system.

Any of these could be written in Elixir with appropriate libraries and translators. The company I worked at generated the BMS maps and COBOL source from assembling program components with an inclusion/override macro processor and wysiwyg editors--think Visual Basic for mainframes targeting both CICS and IMS.

Re:Ask HN: How do I learn real-world COBOL? by jhugo on Friday July 01, 2022 @02:57AM (#31943260)
This again focuses on the language rather than the environment. The real issue is all the legacy integrations, and the runtime environment, not the language. A transpiler is solving the easiest part while leaving all the difficult problems unaddressed.
Re:Ask HN: How do I learn real-world COBOL? by p_l on Tuesday June 28, 2022 @02:32PM (#31911279)
The big issue is that for considerable portion of extant COBOL software, you have to deal with entrenched runtime environment. Purely batch processing COBOL might be easier to move to newer languages... And possibly was already picked for rewrite.

Where you're going to hit major issue is with COBOL running under the likes of CICS or IMS, where sure, you can use some more recent languages, but what you'll get in the end will be possibly even worse because now you'll have to find Java programmer who knows CICS.

And CICS or IMS aren't that easy to replace.

Re:Ask HN: How do I learn real-world COBOL? by ElectricalUnion on Tuesday June 28, 2022 @02:10PM (#31911023)
A transpiler/compatibility layer is usually fine, but what you (probably) want instead is a IBM VSAM, IBM JCL, and IBM CICS transpiler/compatibility layer instead - COBOL by itself is very simple and we have working compilers for it already; JCL, VSAM and CICS however, not - that's where the real complex, distributed and hard to reason about parts are.
Re:Ask HN: How do I learn real-world COBOL? by nebula8804 on Tuesday June 28, 2022 @02:15PM (#31911079)
>running critical payments infrastructure

Please tell me its not a payroll company.

Re:Ask HN: How do I learn real-world COBOL? by thr0wawayf00 on Tuesday June 28, 2022 @02:24PM (#31911179)
No, it's one of the largest credit card processors in the country.
Re:Ask HN: How do I learn real-world COBOL? by krylon on Wednesday June 29, 2022 @08:08AM (#31919023)
I'm not sure if that makes me feel better.
Re:Ask HN: How do I learn real-world COBOL? by thaumaturgy on Tuesday June 28, 2022 @02:12PM (#31911039)
I do remember that, and as I pointed out in the thread at the time, New Jersey was asking for volunteers: https://www.cnbc.com/2020/04/06/new-jersey-seeks-cobol-progr...

My first dev job was COBOL on a Unisys mainframe. When the volume of "omg we need COBOL devs" articles got loud, I looked into what was available. The compensation graph for COBOL positions approximately matches those of any other dev job. You can do as well (or better) as a Python dev or Node dev or whatever.

The key to making more money is in specialization. The highest-paying jobs are looking for experience with specific combinations of technologies.

But being a Python dev has the added advantage of not having to deal with COBOL. ...speaking as someone who used Unisys' STRING/UNSTRING OS functions to implement input variable interpolation in COBOL because it has no native string operators or data type.

Re:Ask HN: How do I learn real-world COBOL? by BLO716 on Tuesday June 28, 2022 @01:31PM (#31910566)
Banks. Period.
Re:Ask HN: How do I learn real-world COBOL? by logical_ferry on Tuesday June 28, 2022 @03:24PM (#31911925)
I don't work with COBOL but.I had my fair share of old legacy codebases. I sometimes think about how this crappy codebase first started out. Somebody somewhere had to write the first line of code. Was it exciting for them? Was it a sunny day? What did their office look like? Then I look at the codebase again and all this sentimentalism vanishes.
Re:Ask HN: How do I learn real-world COBOL? by bidirectional on Tuesday June 28, 2022 @01:54PM (#31910820)
Working on incredibly boring retail banking systems which are a maintenance nightmare. If you want to work in a bank you'd get paid more working on front office software at an investment bank.
Re:Ask HN: How do I learn real-world COBOL? by mikece on Tuesday June 28, 2022 @11:14AM (#31908794)
Exactly! You will never learn anything about JCL from a COBOL textbook. Heck, I'm not sure a JCL textbook (if they exist?) would be of much help either. When I went to college I was in the last group of students whose client/server classes were all mainframe based. We had a class where JCL was taught and a valid answer for "Why is JCL syntax so irregular?" on the exams was: "Because it was invented in Berkeley in the 1960s and everyone was on drugs."
Re:Ask HN: How do I learn real-world COBOL? by p_l on Tuesday June 28, 2022 @02:53PM (#31911560)
The truth about JCL is actually worse than "they were on drugs".

In fact, they gave themselves a goal of avoiding making it into a programming language, except unfortunately real life requirements meant it had to gather such features quickly. Other infamous components came because of need to specify in line all sorts of metadata for I/O, because the OS might not have a place to store it - this caused the infamous DD statement that /bin/dd is a joking refence to.

In retrospective, one of the leads on JCL mentioned that they should have instead gone straight for a full programming language, that this way it would have better design.

Re:Ask HN: How do I learn real-world COBOL? by ElectricalUnion on Tuesday June 28, 2022 @02:18PM (#31911123)
There was a ancient saying that new JCL is never written, just copied and modified until it works, because no one understands the entirely of it.
Re:Ask HN: How do I learn real-world COBOL? by schlauerfox on Tuesday June 28, 2022 @12:07PM (#31909500)
I took an IBM mainframe intro course on Coursera and it was pretty good. I learned how to use the editor and menu thing. It was very out of my windows/linux/PC experience.
Re:Ask HN: How do I learn real-world COBOL? by ElectricalUnion on Tuesday June 28, 2022 @02:23PM (#31911169)
> the editor

ed /s

Well, you can invoke AIX and run ed, it works, but yes, ISPF, running in a 3270 terminal, is pretty weird. That being said, it's pretty much very interactive even under horrible latency because it sends the entire screen every repaint.

3270 is, in a retro way, what the web 1.0 would look like if we were limited to monospaced characters.

Re:Ask HN: How do I learn real-world COBOL? by rst on Tuesday June 28, 2022 @02:06PM (#31910970)
Here's a look at mainframe arcana from the perspective of someone with training only on POSIX/Windows era systems -- COBOL was the easy part. Figuring out how to format the program text and submit it to the compiler took... quite some time.

https://medium.com/the-technical-archaeologist/hello-world-o...

Re:Ask HN: How do I learn real-world COBOL? by shireboy on Tuesday June 28, 2022 @11:31AM (#31909014)
This is true, but the niche should be a dev who knows COBOL IRL enough to translate to something newer. Much of the COBOL I've seen would be trivial to rewrite, just nobody wants to tackle it. A person who 1) Can read cobol 2) can communicate well with stakeholders and 3) can translate to NodeJS/Python/.NET should be able to fit this niche pretty well.

I've done this before - translate green screen apps to ASP.NET. In my case, the company had (retiring) IT staff read the cobol and give us good "plain english". The actual ASP.NET code was trivial. That said, my one caveat is I don't feel like any language today has the longevity of these systems. That code was ASP.NET 3 MVC - new at the time, but outdated now. What stack do I pick today that will still be running in 30 years? HTML+JS+NodeJS seems the most likely candidate IMO, but then you get into the various frameworks-du-jur and it sort of falls apart. Would love HN opinions.

Re:Ask HN: How do I learn real-world COBOL? by hyperman1 on Tuesday June 28, 2022 @02:19PM (#31911135)
Some killers here are the data model and the unknown edge cases. And the size.

The data model is fixed width flatfiles with very specific access and index methods. There are 50 years of workarounds applied in there. Whatever code you end up with will still need to communicate with all the other stuff, so the data model can't change untill you got everything touching it in the new language.

The edge cases are a second problem. The code runs well in a very practical sense, as every major bug relevant for the end user has been fixed or worked around ages ago. Or it became the correct behaviour by sheer overwhelming force. You replace something insane, then find out you broke another system that had counterbalancing insanity. Worst case, it will run for a few months, silently corrupting data. Next tax round or year end, some report says something strange, and subsequent troubleshooting uncovers major doodoo. No, the taxman wont wait on your bugfix.

Then there is the sheer volume of code. 10 million lines is small scale. You can spend your whole carreer rewriting everything in the most trivial way, and 40 year later find you're not even close to done. There will be multiple failed rewrites in there, causing massive lavaflow architecture problems.

Re:Ask HN: How do I learn real-world COBOL? by goodpoint on Tuesday June 28, 2022 @11:54AM (#31909322)
Some banks tried to jump on the Java bandwagon when it was the hyped up thing of the moment and now many are going back to COBOL.

> HTML+JS+NodeJS seems the most likely candidate IMO

So that my bank can run npm install leftpad on their payment processors.

Please tell me this is parody.

Re:Ask HN: How do I learn real-world COBOL? by absove on Wednesday June 29, 2022 @04:41AM (#31917782)
> Some banks tried to jump on the Java bandwagon when it was the hyped up thing of the moment and now many are going back to COBOL.

What's wrong with Java that COBOL doesn't suffer from exactly?

Re:Ask HN: How do I learn real-world COBOL? by shireboy on Tuesday June 28, 2022 @12:09PM (#31909541)
Hah, well, right. I just meant from a longevity standpoint. What stack can I use today that is and will continue to be well supported for 30+ years?
Re:Ask HN: How do I learn real-world COBOL? by djbusby on Tuesday June 28, 2022 @12:43PM (#31910010)
I've converted some legacy apps into, not a joke, PHP3. In like 2006-8. So, PHP3 still works this many years later (in VMs). Currently working to migrate to PHP7.

It's just moving business data into and out of, in many cases still file based records (but maybe we can upscale to SQL). So, if you can read the COBOl and implement correctly in the next blessed language (with tests).

Harder part is to meet the folks that can get you those gigs than actually doing the gigs.

Re:Ask HN: How do I learn real-world COBOL? by goodpoint on Tuesday June 28, 2022 @01:15PM (#31910389)
Come on, are you serious? COBOL is still being used exactly because it does not have a high-churn ecosystem. Same for C and C++.

Of all languages, js is by far the most volatile.

Re:Ask HN: How do I learn real-world COBOL? by jhugo on Tuesday June 28, 2022 @12:19PM (#31909682)
C, C++, probably Rust, various other relatively boring languages.

If Node.js is even still used in 30 years it won't look anything like today's Node.js.

Re:Ask HN: How do I learn real-world COBOL? by pc86 on Tuesday June 28, 2022 @02:05PM (#31910954)
> What stack do I pick today that will still be running in 30 years?

This is such a backward mindset, though. Software evolves. Ecosystems evolve. Perhaps most importantly, security risks and surface areas evolve (which in part necessitates the prior points).

There is no good reason for systems to stagnate over three decades. Software isn't construction, it's gardening, and it requires constant maintenance and attention.

Re:Ask HN: How do I learn real-world COBOL? by ElectricalUnion on Tuesday June 28, 2022 @02:17PM (#31911099)
> Software isn't construction, it's gardening, and it requires constant maintenance and attention.

Software is like construction, you don't demolish everything and start from scratch just because it's a little, or very old.

Discarding everything and rewriting in another language is a expensive and error prone process.

To cite the excellent Joel blog:

> the single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch.

https://www.joelonsoftware.com/2000/04/06/things-you-should-...

Re:Ask HN: How do I learn real-world COBOL? by pc86 on Tuesday June 28, 2022 @03:07PM (#31911753)
Where did I suggest rewriting things from scratch?
Re:Ask HN: How do I learn real-world COBOL? by goatlover on Tuesday June 28, 2022 @01:56PM (#31910837)
What makes you think HTML/JS/Node will be anything like it is today 30 years from now?
Re:Ask HN: How do I learn real-world COBOL? by jazzyjackson on Tuesday June 28, 2022 @03:38PM (#31912061)
they are good enough

same reason we are flying 737 aircraft and chinook helicopters, well after we tried concordes and space shuttles.

see "Web Design: the first 100 years" for more: https://idlewords.com/talks/web_design_first_100_years.htm

Re:Ask HN: How do I learn real-world COBOL? by agumonkey on Tuesday June 28, 2022 @10:07AM (#31907851)
the few I've seen, COBOL legacy is its own kind. It meshes decades of users, practices, tools and paradigms. We've been shown code that blend old original code with 3GL crude code generator with 4GL custom COBOL transpiled DSLs with monkey patching. It was really not pretty (to stay polite).
Re:Ask HN: How do I learn real-world COBOL? by hermitdev on Tuesday June 28, 2022 @01:04PM (#31910265)
My last project as an intern was to rewrite an old batch processed COBOL app into a simple webform in C#/ASP.Net. The COBOL app was nothing special, really. From what I recall, it was around 65 pages printed. Took me a while to comprehend what was going on, but the first 80% or so was basically just hard-coded rules to take action on based upon user input. Things like when "B", generate "X" & "Y". When "A", generate "X", "Y" & "Z" sort of thing. Nothing fancy, at all. Once I figured out what was going on, I basically just ran the COBOL through some regexs, transformed into an XML doc (don't judge me - it was early 2000s) and wrote the rules engine in maybe one or two screenfuls of C#.

I did learn one thing, and that was COBOL has one up on 'goto'. Check out the control flow statement: MOVE NEXT SENTENCE. It's basically a goto, but it doesn't jump to a label, per se. Instead, it jumps to the next period in the source. Yes, in a big, blocky, verbose language like COBOL, where everything is in UPPER CASE, you're now looking for a teeny tiny period that is easily lost in the verbiage. Hands down, my least favorite programming language construct ever.

Re:Ask HN: How do I learn real-world COBOL? by JD1967 on Wednesday June 29, 2022 @09:12AM (#31919619)
NEXT SENTENCE (not "MOVE NEXT SENTENCE") is sort of equivalent to "continue" in modern languages.

In more "modern" COBOL's like COBOL-85, there is actually a "CONTINUE" which is essentially a no-op.

Some COBOL shops instituted a "one-period-per-paragraph" rule (on the last statement in a paragraph) to avoid some of this. And COBOL-85 (thankfully) added scope delimiters (i.e. END-IF) to help avoid the issues with periods.

Re:Ask HN: How do I learn real-world COBOL? by agumonkey on Tuesday June 28, 2022 @03:21PM (#31911880)
You never ran into an ALTER ?
Re:Ask HN: How do I learn real-world COBOL? by ElectricalUnion on Tuesday June 28, 2022 @02:26PM (#31911190)
> COBOL transpiled DSLs

That problem happens with any transpiled language really, now you have all the problems of the new language and all the problems of the target language, and you need to fix "supposedly compiled" output by hand sometimes.

Re:Ask HN: How do I learn real-world COBOL? by agumonkey on Tuesday June 28, 2022 @03:20PM (#31911874)
I've nothing against cobol, but I think it's worth there, because of the gap with a python like lang (IBM made one) and cobol. Coffeescript to es5 wasn't too hard to guess.
Re:Ask HN: How do I learn real-world COBOL? by peter303 on Tuesday June 28, 2022 @10:32AM (#31908178)
Like the nightmare language IBM OS DDL? (data definition language) I recall you have specify the physical layout of data files on disk. In UNIX this info is embedded in the file system and generally not needed to run a program.
Re:Ask HN: How do I learn real-world COBOL? by ElectricalUnion on Tuesday June 28, 2022 @02:31PM (#31911269)
> In UNIX this info is embedded in the file system and generally not needed to run a program.

UNIX just considers that a file/stdin/stdout/stderr is a sequence of binary octets of arbitrary size, any information on how to deal with it is left entirely to the program.

In a way, IBM VSAM and other record access methods are more like tables with types that a UNIX-like file sytem.

Re:Ask HN: How do I learn real-world COBOL? by kazinator on Tuesday June 28, 2022 @10:31AM (#31908165)
"I'm gonna learn C and start an embedded firmware job!"
Re:Ask HN: How do I learn real-world COBOL? by yodsanklai on Tuesday June 28, 2022 @01:07PM (#31910306)
You got to start somewhere
Re:Ask HN: How do I learn real-world COBOL? by hugg on Tuesday June 28, 2022 @09:38AM (#31907520)
Yeah, this is what I learned too from working at a big government pension office
Re:Ask HN: How do I learn real-world COBOL? by Zenst on Tuesday June 28, 2022 @10:22AM (#31908056)
aye decades of COBOl here though I did it upon the wrong non-IBM platform, RIP ICL and Honeywell
Re:Ask HN: How do I learn real-world COBOL? by JD1967 on Wednesday June 29, 2022 @09:16AM (#31919663)
Yeah, I programmed in COBOL for 15 years on Unix systems... so I don't have any mainframe experience... I'm pretty good with the actual COBOL code, but as people have said, that's only a piece of it. Working with the environment, such as IBM mainframes, is a big piece. Which is sort of odd, because COBOL was supposed to be "common"...
Re:Ask HN: How do I learn real-world COBOL? by klelatti on Tuesday June 28, 2022 @10:50AM (#31908440)
Presumably these platforms have also lived on though. I think I remember reading about a Fujitsu contract to maintain a big U.K. government ICL derived system?
Re:Ask HN: How do I learn real-world COBOL? by Zenst on Tuesday June 28, 2022 @11:27AM (#31908960)
There isn't the work on the market for any of those and from my experience of working with on their contracts, they will all be tuped existing staff.

As an aside I still have a zero-day for ICL mainframes running Gerorge that's decades old now and taking to my grave.

Re:Ask HN: How do I learn real-world COBOL? by klelatti on Tuesday June 28, 2022 @11:44AM (#31909208)
Interesting - thanks. Won’t get fixed now. I’m guessing all emulated and running on x64 by now.
Re:Ask HN: How do I learn real-world COBOL? by chasil on Tuesday June 28, 2022 @11:26AM (#31908943)
Long live EXEC 8.
Re:Ask HN: How do I learn real-world COBOL? by ejb999 on Tuesday June 28, 2022 @09:44AM (#31907574)
this is the best answer.