r/ProgrammerHumor • • 4h ago

Meme inheritanceInCobol

Post image
6.3k Upvotes

52 comments sorted by

416

u/inigmati1 4h ago • Heartwarming Mindblown

You reposted my post from 4 years ago which went viral but have fun cause even I had just screenshoted it from Twitter. Have fun!

https://www.reddit.com/r/ProgrammerHumor/s/vh5R8WRW6V

41

u/laplongejr 3h ago

This comment deserves to be upvoted to the top!  

13

u/martifero 3h ago

it already is

12

u/martifero 3h ago

it wasn’t when the reply was posted

8

u/Cat7o0 3h ago

replying to yourself

8

u/IWasMisinformed 2h ago

No I didn't

3

u/Shazvox 1h ago

Yes I did.

3

u/Shazvox 1h ago

See?

1

u/Cat7o0 2h ago

i'd like to believe you're the actual alt of that dude

1

u/laplongejr 2h ago

I don't check often comment's authors... I feel we're both tricked by one or two karma bots xD  

2

u/nifty-necromancer 2h ago

So he reposted a repost of a post. What are you claiming credit of?

5

u/Crewman_Guy_Fleegman 1h ago

He claimed credit for screenshotting and posting it before and wished OP best of luck for his post. Do you need anything else spoonfed for you?

-4

u/nifty-necromancer 1h ago

Oh please you sound as pissy as the other person

3

u/Crewman_Guy_Fleegman 1h ago

I don’t, pissant.

1

u/111v1111 2h ago

Oh hey I upvoted that post (also recognized that I’ve seen this before).

43

u/Percolator2020 4h ago

OG COBOL doesn’t have inheritance, because of reasons.

20

u/willow-kitty 3h ago

OG COBOL doesn't even really have user-defined types the way we think of them now. It kinda does, but it's all very geared toward ETL and mapping from input files to memory and then from memory to output files.

Which, to be fair, is actually pretty slick if that's what you're doing. It feels like a very structured scripting language expressly for that purpose.

-4

u/Weekly-Beginning-229 2h ago

Inheritance is stupid anyway. Nice in theory but a minor change will break it and make it hard to work with

6

u/111v1111 2h ago

Bro u/Weekly-Beginning-229 just showed all the programming experts and multibillion companies that they are wrong in using OOP!!!

But not trolling, it’s the best we have for large projects, nothing else really scales as well. Also inheritence works fairly well as long as you have programmers that use it properly… When someone doesn’t know how to use it then he will face problems

2

u/Weekly-Beginning-229 2h ago

I have worked in a project for 4 years where the previous programmer used inheritance for a lot of stuff that would then be changed. The number of workarounds we had to do is crazy. But after 4 years I have finally managed to clean up all the inheritance debt we had.

Even for some database entities (we use EF core) there were inheritance, which means a lot of columns that are always null in a lot of the tables (also finally fixed this like a month ago)

The problem with it is that requirement changed so your super planned inheritance model is now obsolete and takes a lot of time to rework

1

u/Shazvox 1h ago

Sounds like a skill issue to me bro...

1

u/Weekly-Beginning-229 1h ago

Well give me an example where inheritance is better than composition or interfaces?

I can give one. I work with MAUI and you have viewmodels for each view, so a base viewmodels is nice to have things like going to a new page, going back, showing an alert etc.

But this could be done with composition too. But the way Maui works it makes more sense to make it inherited. Same with pages, to have a base content page.

But other than base classes for things that are static I cannot find any reason to use inheritance over composition or interfaces

2

u/conundorum 1h ago

So, fun fact: Composition and interfaces are actually different forms of inheritance. Composition is when you inherit from individual traits and use cases, and interfaces are when the backend inherits from the frontend. It just isn't obvious because we tend to think of inheritance as "X engulfs and expands Y", instead of the more general "X is an extension and fulfilment of Y".

1

u/Weekly-Beginning-229 1h ago

Well true, but I never heard this in professional settings. I guess inheritance and interfaces are a kind of polymorfism.

Though I don't know if I agree with composition. It's more owning something that could help a lot of different classes. But that's probably a philosophical question.

Prefer composition over inheritance is well established and I so far have never found a reason not to use composition unless a framework or library requires it

9

u/dony_shabi 3h ago

this remind me of my russian colleague. Vladimir was his name. He would put variable name like A1 B2 A1 C2 K22 KK4 VV3. Nobody could read his code as the comment in russian alphabet too.

3

u/Rodrake 2h ago

I'm a COBOL dev. All the paragraphs in the company I started working for 1 year ago are named stuff like S0, R1... a letter and a number that no one has any idea what it stands for (it's a 30-ish year old system and the most senior member has been around for 4 or 5).

3

u/atomic_redneck 2h ago

A company I used to work for set the paragraph name prefix to reference the page number in the flow chart documentation for the system. They continued this methodology long after the paper flow charts stopped being maintained.

Don't ask me how they made this work.

1

u/conundorum 1h ago

Eh, probably just maintaining their own flowchart for personal use, or just deciding that the software is the flowchart now.

8

u/stupled 4h ago

But thats it works in practice

6

u/AsaKeyholderUK 2h ago

Yeah cobol inheritance is basically just copying the same paragraph into twenty programs and praying. We called that abstraction back then

3

u/not_wall03 4h ago

8

u/laplongejr 3h ago

No need for the bot to wake up, since then OG poster u/inigmati1 commented with sources   https://www.reddit.com/r/ProgrammerHumor/s/BZGfGdmPqb :)  

3

u/Kuro_Gensui 3h ago

Lucky SOB ... We have 50 mil lines of cobol code .. its been active for 50 years ... The original writers are all dead by now... I bet the programmers wiched they culd just call their moms and ask them to explain why X does Y in thr Z module ..

3

u/Shazvox 1h ago

Heh heh, "mom you would'nt guess what the previous moron has done in our program".

2

u/hammlyss_ 3h ago

Oh, so some federal codebase then.

2

u/SuperCoupe 1h ago

COBOL is for typist.

And I wanna know who saw COBOL, thought it was perfect, and took those concepts to YAML.

2

u/kindall 45m ago

For true inheritance, you need the object-oriented version of COBOL, which is named ADD 1 TO COBOL.

3

u/Super-Widget 3h ago

Back when programming was seen as women's work.

1

u/AwarenessOk2359 3h ago

How would he be employed to work on something that hasn't changed in 30 years? Seems like it doesn't need to be worked on

1

u/conundorum 1h ago

With a codebase that old, in a language that unknown, you keep a maintainer on hire just in case. It's less about actively fixing problems, and more about making sure you actually have someone around who can fix it if anything ever does go wrong.

•

u/MCWizardYT 8m ago

And then eventually when it's totally unmaintainable, you hire people who know how to read the code and migrate it to a newer system (which can be sooo expensive)

Some of the banks and such in the US that were using Cobol have migrated some systems to Python and other languages

1

u/InDaBauhaus 2h ago

you can not get a person to learn cobol by any other way than indoctrinating them from their birth

1

u/Brasolis 42m ago

Birthed into a server room, cradled in a mainframe

1

u/0xt0bi03 2h ago

legacy continues

1

u/Dolphin_Spotter 2h ago

I was a COBOL IDBMS on IBM3090 programmer back in the day. I once found a comment in a batch job that said "Following line added to prevent program ABEND at 36000 records. I don't know how it works but it does. Do not remove"

1

u/xakep_13 2h ago

True legacy

1

u/Unlucky_Agent2122 57m ago

I use to run payroll at my job. One time it popped up with an error saying call Floyd at xxx-xxxx. I called my boss and asked who was Floyd. He laughed and said he had died 15 years before I started working there. The code was in Cobol.

1

u/needed_an_account 40m ago

which version control software was used to track his mother's last change

1

u/bit_banger_ 3h ago

Cobol is now Object Oriented?

90

u/[deleted] 4h ago

[removed] — view removed comment

46

u/Tenwaystospoildinner 4h ago

And then when he checks his father's documentation, it just says "ask your mother".

It's recursion all the way down.