r/ProgrammerHumor • • 7h ago

Meme inheritanceInCobol

Post image
9.1k Upvotes

60 comments sorted by

640

u/inigmati1 7h ago • Heartwarming Mindblown Popcorn

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

59

u/laplongejr 6h ago

This comment deserves to be upvoted to the top!  

24

u/martifero 6h ago

it already is

16

u/martifero 6h ago

it wasn’t when the reply was posted

16

u/Cat7o0 6h ago

replying to yourself

13

u/IWasMisinformed 5h ago

No I didn't

5

u/Shazvox 4h ago

Yes I did.

6

u/Shazvox 4h ago

See?

1

u/Cat7o0 5h ago

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

1

u/laplongejr 5h ago

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

1

u/nifty-necromancer 5h ago

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

14

u/Crewman_Guy_Fleegman 4h 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?

-13

u/nifty-necromancer 4h ago

Oh please you sound as pissy as the other person

8

u/Crewman_Guy_Fleegman 4h ago

I don’t, pissant.

1

u/snacktopotamus 1h ago
public RePost : Post {
    public GetUpvotes (UpvoteStealer stealer) {
       int upvotes = stealer.GetThoseUpvotesBitch
    }
}

•

u/normVectorsNotHate 1m ago

Open source meme

1

u/111v1111 5h ago

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

60

u/Percolator2020 7h ago

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

29

u/willow-kitty 6h 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.

-6

u/Weekly-Beginning-229 5h ago

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

8

u/111v1111 5h 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 5h 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

0

u/Shazvox 4h ago

Sounds like a skill issue to me bro...

2

u/Weekly-Beginning-229 4h 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

3

u/conundorum 4h 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 4h 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

1

u/VictoryMotel 1h ago

So fun fact: no they aren't.

16

u/dony_shabi 6h 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.

10

u/Rodrake 5h 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).

8

u/atomic_redneck 5h 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.

3

u/conundorum 4h ago

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

1

u/pantagathus 2h ago

These was a story about some guy working on the US Social Security system - he'd been there 17 years and he was the junior.

13

u/AsaKeyholderUK 5h ago

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

10

u/stupled 7h ago

But thats it works in practice

9

u/Kuro_Gensui 6h 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 ..

7

u/InDaBauhaus 5h ago

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

5

u/Brasolis 3h ago

Birthed into a server room, cradled in a mainframe

2

u/Affectionate_Ad_3722 1h ago

swaddled in paper tape

7

u/Shazvox 4h ago

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

7

u/kindall 3h ago

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

4

u/not_wall03 7h ago

9

u/laplongejr 6h 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 :)  

4

u/SuperCoupe 4h ago

COBOL is for typist.

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

4

u/Unlucky_Agent2122 3h 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.

7

u/Super-Widget 6h ago

Back when programming was seen as women's work.

3

u/Dolphin_Spotter 5h 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"

3

u/PassiveMenis88M 2h ago

So is this just a repost sub now?

2

u/hammlyss_ 6h ago

Oh, so some federal codebase then.

2

u/EuenovAyabayya 1h ago

We talking about Grace Hopper's kid? No, "mum" is British...

1

u/AwarenessOk2359 6h 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

3

u/conundorum 4h 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.

4

u/MCWizardYT 3h 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/0xt0bi03 5h ago

legacy continues

1

u/xakep_13 5h ago

True legacy

1

u/needed_an_account 3h ago

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

1

u/ApatheistHeretic 1h ago

"These are your mother's old parenthesis. A more elegant weapon for a more civilized age.." -- A slandering of Randall Monroe..

1

u/bit_banger_ 6h ago

Cobol is now Object Oriented?

90

u/[deleted] 7h ago

[removed] — view removed comment

46

u/Tenwaystospoildinner 7h ago

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

It's recursion all the way down.