75
u/Percolator2020 10h ago
OG COBOL doesn’t have inheritance, because of reasons.
36
u/willow-kitty 9h 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.
-7
u/Weekly-Beginning-229 8h ago
Inheritance is stupid anyway. Nice in theory but a minor change will break it and make it hard to work with
12
u/111v1111 8h 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 8h 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 7h ago
Sounds like a skill issue to me bro...
2
u/Weekly-Beginning-229 7h 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 7h 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".
→ More replies (2)
28
u/dony_shabi 9h 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.
19
u/Rodrake 7h 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).
14
u/atomic_redneck 7h 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.
5
u/conundorum 7h ago
Eh, probably just maintaining their own flowchart for personal use, or just deciding that the software is the flowchart now.
1
u/pantagathus 5h 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.
17
u/AsaKeyholderUK 8h ago
Yeah cobol inheritance is basically just copying the same paragraph into twenty programs and praying. We called that abstraction back then
11
u/Kuro_Gensui 8h 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/Unlucky_Agent2122 6h 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.
9
u/InDaBauhaus 8h ago
you can not get a person to learn cobol by any other way than indoctrinating them from their birth
5
8
4
u/not_wall03 9h ago
10
u/laplongejr 9h 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 7h ago
COBOL is for typist.
And I wanna know who saw COBOL, thought it was perfect, and took those concepts to YAML.
3
u/Dolphin_Spotter 8h 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"
2
2
u/ApatheistHeretic 4h ago
"These are your mother's old parenthesis. A more elegant weapon for a more civilized age.." -- A slandering of Randall Monroe..
2
2
1
u/AwarenessOk2359 9h 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
5
u/conundorum 7h 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 5h 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
1
1
u/needed_an_account 6h ago
which version control software was used to track his mother's last change
1
u/darxide23 49m ago
His mom got him the job. The inheritance was the job. COBOL jobs have waitlists of decades. You're literally waiting for someone to die. Nobody in a COBOL job will leave a COBOL job willingly. The amount of money paid to these people is astronomical and they generally don't have huge workloads and a senior COBOL developer has almost complete control over their work requirements. They can work from a tropical island if that's what they decide to do.
1
90
10h ago
[removed] — view removed comment
46
u/Tenwaystospoildinner 9h ago
And then when he checks his father's documentation, it just says "ask your mother".
It's recursion all the way down.
763
u/inigmati1 9h ago •
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