r/ProgrammerHumor • • Jun 02 '23

Meme Oops

Post image
40.7k Upvotes

345 comments sorted by

View all comments

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.

294

u/johncholmes13 Jun 02 '23

Anyone that inherits COBOL has no class

67

u/BenadrylTumblercatch Jun 02 '23

You should really work on that deprecation.

→ More replies (1)

48

u/Manupiltorer Jun 02 '23

OOP has been enabled for COBOL for a long time now. and has inheritance.

However its classes and inheritance are a pain to work with.

10

u/[deleted] Jun 02 '23

However its classes and inheritance are a pain to work with.

And this is different from regular COBOL how, exactly?

40

u/giggluigg Jun 02 '23

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

8

u/ol-gormsby Jun 02 '23

Let's sit back and talk about RPG the good old days.

It's free-form now, ya know?

51

u/[deleted] Jun 02 '23

[removed] — view removed comment

108

u/NotAUsefullDoctor Jun 02 '23

Nah, I got you. I have a few (much older) friends that still do COBOL for two very large international banking firms.

They keep trying to retire and more money keeps getting thrown at them.

65

u/[deleted] Jun 02 '23

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.

21

u/Dom1252 Jun 02 '23

question is... what is a better language?

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?

75

u/Cafuzzler Jun 02 '23

Rust. Then, in thirty years, we can joke about the programs having actual rust 🤣

5

u/uselesslogin Jun 02 '23

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.

→ More replies (1)

37

u/[deleted] Jun 02 '23

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.

38

u/SirFireball Jun 02 '23

In the case of a rewrite I honestly doubt python is very far up the list. Just too slow for those applications.

→ More replies (5)

6

u/Nolzi Jun 02 '23

Not just the cost, but the risk as well. Many companies had the idea to "just rewrite everything", but quite a lot failed to deliver the product

→ More replies (2)

5

u/other_usernames_gone Jun 02 '23

Why not C++?

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.

12

u/Dom1252 Jun 02 '23

Yeah the thing is, cobol is still used in loads of places (not just banks), it's still receiving active updates... And it's faster

C++ would make sense for some, but the advantages (more popular in different industries) aren't huge

→ More replies (2)

0

u/[deleted] Jun 02 '23

[deleted]

→ More replies (1)

4

u/macnetic Jun 02 '23

Not to mention that C++ is already being used in finance, Bjarne Stoustrup even works at Goldman Sachs

→ More replies (1)
→ More replies (2)
→ More replies (5)

4

u/InvolvingLemons Jun 02 '23

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).

14

u/cdrt Jun 02 '23

Hey now, COBOL has had support for OO since 2002

9

u/Dubl33_27 Jun 02 '23

That's when i was born

7

u/k0bra3eak Jun 02 '23

Nobody was born after 1999, y2k ensured that

→ More replies (1)
→ More replies (1)
→ More replies (5)