We wrote our programs on special pads of paper, transferred them to punch cards, gave our decks to operators who would run our programs on an IBM. Around a half hour later the operators gave us back printouts with the results of our runs. Most people didn't wait around but my friend and I would stay late so we could get more runs in. If we were nice to the operator they might bump our job up in the queue.
Most of the programs we wrote were very simple. Things you could easily do now with a few lines of a modern scripting language.
Our class's teacher was a professional COBOL programmer who had a day job working at a soda company. Some kind of emergency came up at his job half way through the course and he stopped showing up so we were left on our own for a few weeks.
Just before the end of the class the department head took over and told everyone they would need to implement a binary search on the final exam. This was way too hard for most of the other students but not a big deal for my friend and I. We were done in a few minutes.
I was also fortunate to meet another guy in the class who asked me to help him with some programs he had to write at his job. He was a soil engineer who wanted to move into a finance job but found the programming work difficult, so I spent a few hours a week tutoring him and writing programs with him.
Eventually I graduated and he ran out of work for me but by then we became good friends. While I can't say I got much out of of the COBOL class I'm glad I took it because if I hadn't I would not have met him.
The COBOL spec doesn't allow recursive "paragraphs" (functions), though some implementations support it. (This may no longer be the case, or this limitation may have been specific to the language version used at my job.)
The main limitation is I/O, though. You typically use JCL to indicate what files/DBs a program will run against, and I recall that everything that touched the network was written in Java and called from JCL (whether this was because networking libraries don't exist in COBOl or because those that do are terrible, I couldn't say).
Recursion and loops are interchangeable.
From Wikipedia "other compilers, like IBM COBOL, will produce code that prints "1 2 3 END END END END ..." and so on, printing "END" over and over in an endless loop." [1]
Also, having never used COBOL, the PERFORM statement is pretty cool. Like calling arbitrary parts of a Switch statement with a single line. Would be neat if some other languages had that.
In non-mainframe realms, while the good news is that there's no JCL, the bad news is that individuals and companies have pretty much reinvented the JCL wheel over and over again, creating their own hodgepodge of unique, non-standard efforts to deliver smidgeons of similar functionality hacked together from a mix of shell scripting, environment variables, YAML, JSON, other config files, manual prompting, third-party libraries and software, and even hard-coding resources in programs.
Grass is always greener, as they say. :-)
https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pag...
I wouldn’t say I did it for fun, but I did do it for the learning experience. My university was very invested in COBOL, and I had classmates who got offers much larger than mine to work for various finance companies in Wisconsin, so I had already learned the basics of language.
It’s hard for me to separate the COBOL from all of the other dysfunctional things going on at the company. I knew that the language was a dead-end and did not want to get stuck with it. Not because I didn’t like the language, but because I was 21 and “Web 2.0” was in full swing and I knew I wanted to do something “cool”.
Migrating data files to new descriptors was always a stressful time. The equivalent of a database schema change, but you had to load the old files and rewrite in the new format largely manually.
The tooling we used felt dated, but worked well enough. Better than the tools we used in school.
I always used “Murach’s Structured COBOL” [1] as my primary reference. Carried that book just about everywhere during that time.
[1]: Murach's Structured COBOL https://a.co/d/hONfFT7
I think this is an often under-appreciated point -- languages don't live in isolation, but within a wider context of libraries, people using the language, and institutions and jobs with jobs that use the language.
As another example on this point -- at my current job, for some reason much of the backend has been written in Haskell. Haskell's a fine language, I actually really like many aspects of it. Our main product, however, is web based, a domain Haskell is completely able to handle on a technical level. In practice, though, it's a poor fit, and I find myself constantly puzzling at all the odd, non-idiomatic ways web architecture has been set up, often in ways that make it very difficult to make things work well for the web. In many cases, this has been carried over into some questionable typescript as the backend programmers then had to also try and become frontend programmers.
None of these problems are because of Haskell the language or because the original programmers were bad programmers, but because their background, and the majority of the Haskell ecosystem, just isn't really web-focused, and so conventions and assumptions most people who work mainly on the web take for granted they were unaware of or got wrong.
A language is more than just syntax and standard library, it's part of a broader culture.
To me, there’s an ecosystem and a culture for a language in a situation.
The ecosystem is the tooling around the language. Debugging, performance profiling, building and dependency management are examples.
The culture is how the language is used in real life. How stable is the ecosystem?
There are lots of beautiful languages that are used horrifically. Enterprise OOP is an example for me where more than half the code is dedicated to avoiding basic principles for “what if we want to change later” (looking at you getters and setters).
And within a company or software suite, there can be subcultures of how “we” use the language. Every class needs an interface. Our C is written OO (see old GNOME).
For the ecosystem you have extremes. C where debugging and performance profiling are well defined practice, but modern dependency management doesn’t exit. The JavaScript ecosystem changes so rapidly, documentation is usually out of date, “nobody does that anymore”, etc.
And so much awful comes from trying to force a language into something the language wasn’t originally designed or even used for. Your Haskell example here. Adding functional language features and convoluted asynch to every freaking language is another. People create things much harder to learn than a new language with a mature ecosystem and culture in a domain just to avoid “learning a new language.”
In woodworking, I can do pretty much anything with a chisel. But I plane with a plane, saw with a saw, use specialty planes for rabbets, etc. Each has a learning curve, but I’ll end up with a better, more consistent result. And really, they’re all just chisels with jigs in different configurations. But I’m going to use a chisel where it’s still best, like mortising. Well, and where I’m not sure I want to invest in a more specialized tool yet and risk my wife killing me. Then I use C… I mean, a chisel.
At eleven years, that sounds more like an apprenticeship than an internship.
Northwestern Mutual is based in Milwaukee and is where most of the grads I knew who went down the COBOL path either started out or ended up.
Mess around with it if you want, sure. Just realize it's a limited language with specific use cases and you're unlikely to ever touch it outside of those, even as a hobby/"for fun".
Anecdotally I was talking with a COBOL vendor way back in the mid-80s and he had mentioned that their COBOL compiler was itself written in COBOL.
FORTRAN also suffered limitations back in the day, notably lack of dynamic memory, yet folks were able to write sophisticated systems in it as well.
Imagine trying to program a desktop application in SQL. You could probably achieve it through some use of triggers and interfaces, but it would be a nightmare. It's not quite as bad for COBOL, but a similar story.
I could have gotten a job doing this work very easily. When I was applying and interviewing at my university career fair, I got a lot of interest and a couple job offers from having this class on my resume, but the pay wasn't good (small city it the south US that I wanted to leave), and I didn't want to lock myself into mainframes.
Columbus, GA, by any chance?
Most COBOL programs have a very well-defined batch-oriented flow: take this file, process it, then output these file(s) within N hours. Reliability is paramount: batches often run overnight, and you don't want operators getting angry with you. And there is an entire ecosystem, all consisting of proprietary (and expensive) IBM solutions like CICS, that make CRUD apps (which, admit it, is like 80% of all software...) pretty much a piece of cake.
The downside of all this, is that you're very much limited to whatever your vendor allows, that progress is glacial, and that innovation is pretty much unheard of (since that might break the batch, which is... a mortal sin). And, like with the Unix philosophy, orchestration of all those single-minded processes becomes an issue after a (short) while.
If anyone were to ask me whether they should "learn the language", my answer would be an unqualified no, unless it's for a specific paid assignment. There are no unique ideas hiding anywhere in COBOL that are absent from more modern (and more 'fun') languages.
But does it matter to learn the language paradigms and orchestration requirements? Sure: you may land a good gig if you understand where AS400s/i-Systems/whatever fit in, and it may give some insight into where things like Docker and K8S are coming from.
As other folks have described programming on the mainframe is about learning COBOL + JCL. I would also add that you need to understand how to read/write binary files according to a defined schema (Copybook) and encoding (EBCDIC, COMP, COMP-3, COMP-5). It's also helpful to deeply understand the intricacies of Db2 and different methods of connection (ODBC, JDBC, Db2 CLI).
I've even gone so far as to write an ODBC extension for DuckDB so that we can scan and process queries faster and with less MIPS usage. https://github.com/rupurt/odbc-scanner-duckdb-extension
"People who don't know the difference between etymology and entomology bug me in ways I cannot put into words."
It is ok for storing and updating records, but writing complex algorithms would be slow
It's a language that's built for one purpose, business style applications like CRMs or accounting systems. It's not mystically bad or so undecipherable. It's actually a pretty simple language. If you're consulting/contracting developer, or an in-house developer at a bank, insurance company, etc., you should learn it. Even if you don't do anything with it, you can pick up a used book on COBOL and get most of the regular patterns and practices.
Learning the basics of the language itself, if you've already a competent programmer, won't take you long. Maybe a half dozen weekends. But COBOL exists in an environment (normally IBM mainframes) that does a lot of the other lifting. CICS is an application server for COBOL (essentially). JCL manages what job to run and when. VSAM for indexed files or DB2 are the most common databases. And WebSphere for messaging. Becoming a 'real' COBOL developer on a mainframe is maybe 33% COBOL and the rest a miasma of mainframe-isms. And unlike Linux, there's no 'free' equivalent to a mainframe. (Although you can spend about $40 a day accessing a mainframe on IBM's cloud).
A few weekends won't turn you into a COBOL migration expert, but you can at least join the rest of us, rolling our collective eyes, when the governor of New Jersey asks for volunteer cobalt [sic] programmers because some key system is breaking down.
My first job was supporting a custom application running in UniVerse on Solaris. It originally ran on a Prime mainframe and UniVerse was one of the ways you could run this type of software on a modern system. I really enjoyed working in the Pick MultiValue environment. In many ways, this was a NoSQL database from before NoSQL was a big thing.
I don't work in this world anymore, but I've been playing with ScarletDME (a fork of OpenQM, another MultiValue database, from before they closed the source) and seriously enjoying it.
As a result of this first job I've got a special place for "old" programming languages/environments. My dream retirement job is to work for either the CRA or IRS supporting their old systems. Between the complexities of income tax and the old-school code that can never be retired I think I'd love it.
I really love it. I think there are a number of language features (like the memory handling) which have elements missing from a lot of modern languages.
Using the AS400 was very interesting as well.
The problem about COBOL, for me, is it's so specifically designed to fill a niche of business record processing, that I'd never use it for a side project. It's too verbose, and too restricting.
Yes, the processing COBOL does is restricting, but then my first full-time programming job was two and a half years writing RPG II code. COBOL would have been an upgrade.
In one word - minefield!
I've also coded COBOL at a few places, both on PC and on mainframes years back.
But I can honestly say that I have never done anything in COBOL for the fun of it.
However this is not to dissuade anybody from ever doing this. COBOL and a few other old languages are still used in areas like banking today. So you might cross it at some point in time, even at the most modern workplace.
But as others have written in the comments, there is more to it than the language itself. You should really have a mainframe emulator (like Hercules) and other parts of the environment like CICS, TSO, ISPF and JCL if you really want to know how it feels like to code in COBOL. I don't know if it's even possible to get all of this up and running for free, but that could be a challenge in itself.
In the case of COBOL, calculations were tedious. I escaped into the loving arms of the COMPUTE statement. I later read that this was a cultural violation similar to using unPythonic code in Python. But I didn’t have a mentor, much less a reviewer.
I think this counts as “for fun”. I later earned minor ducats writing little RPG programs, and the rest of my career has been far, far away from such programs.
Learn COBOL in a day
https://news.ycombinator.com/item?id=37388560
COBOL gets new life in the cloud thanks to Watsonx and AI
It was an interesting experience, but absolutely nothing about it was enjoyable, the language, the tooling, the support. All of it.
We keep joking maybe she should apply for one of those high paid legacy COBOL jobs that make their way into the news cycle now and then.
I have programmed in COBOL on ICL and IBM computers. You don't just program in COBOL, you need to learn SQL, JCL, TSO, CICS, etc. Maybe it is simpler with MicroFocus (or similar) COBOL on Linux, haven't ventured there.
Am I remembering correctly?
I then got a short contracting gig when I needed some cash. It was good money - and I never wanted to do that kind of work again. The language has any number of deficiencies, that have been fixed by later languages. And as another commenter mentioned - the departments that use it have any number deficiencies, many of them political, that got them into this position.
It is not something I would recommend for fun.
and as others have observed, it's the infrastructure (JCL, TP monitors, etc.) which is the real problem.
http://www.coboloncogs.org/INDEX.HTM
Haven't used it in anger though.
RPG2 was fun, TUTLY was ... interesting. COBOL? Never again.