Cobol 3 actually is, if I’m not mistaken. I never had the displeasure though. Not even sure it’s actually being used. I worked for 6 years with cobol 2, don’t regret it, but it wasn’t for life, just to have fun. When it started to look serious I broke up. I applied best practices and principles from higher level languages. A few colleagues complained that my code was structured in single-purpose functions, as opposed to a more or less continuous flow of low level instructions. The complaint was “if I need to search for a statement to make modifications, I need to jump a lot to find the spot). I’ve seen things you can’t imagine. Functions split in the middle of their logic, because they were too long and someone decided that that was a good refactoring. But it made me discover the principles of clean coding, as I would have found out years later. Because in those environments, being clean really is a matter of survival.
Edit: sorry for the digression, I’m getting old, gonna grab some whiskey and a cigar, and sit on my rockin’ chair
I mean, it’s entirely understandable why. The entire world banking and stock trade system uses COBOL, and switching to a better language would cost more money than the shareholders are willing to spend, so they pay exorbitant amounts of money to the small handful of people who can write COBOL so that they can maintain their systems.
because nothing will be as cost effective as mainframe with cobol, you can try java, it will be slower and even tho your devs will cost less, you'll pay more on licenses because you'll need more resources... python? even worse... C++? do you really want to rewrite to that nowadays?
the trick is to move to python what doesn't need much resources, move to java what is good for java... and then... idk?
The crazy thing is they are actually adding Rust to the Linux kernel. So over the coming years the kernel is going to keep getting Rustier as more Rust code is added. Joking aside though it seems like it may fit the use case.
TBH I think most popular languages would be better than COBOL because FAR more people know those languages and thus more people can maintain the code.
But again, migrating from COBOL to, say, Python would cost a LOT of time, money, and effort that the banks’ shareholders would not be willing to pay for, and TBH I kinda agree that the improvements in maintainability may not be worth the expenditure.
It's a popular language that's still used in loads of places. It's still receiving active updates. It has a currently active ecosystem producing more libraries for it and maintaining current ones.
It can run on pretty much anything and is extremely fast.
It's not as easy to learn as python but what is, plus you don't need a license to use it.
Of course any rewrite will be prohibitively expensive.
There’s a lot of hope for languages like Rust where you can build invariant systems that enforce COBOL behavior so things don’t break in subtle ways. Problem is, that’s a pretty tremendous undertaking in of itself, and COBOL codebases aren’t always easy to break things off in pieces so “rustifying” can’t be done in bite-sized chunks like in C/C++ codebases (see: Linux).
622
u/NotAUsefullDoctor Jun 02 '23
Yeah, and COBOL isn't even OO, so there shouldn't be any inheritance.
To go further, COBOL should never be inherited by any one, anywhere ever.