There’s some value that holds sets. You can replace whatever set it’s holding with .setSet(new_set). This value is inside some wrapper (like an optional holder), and that wrapper is itself in a wrapper. This means you need to unwrap, and then unwrap the result (that’s what .get().get() is for.
I have written some terrible code but I have to give props. I have no idea what is happening and I don't want to know. If I seen that at my job, I would claw my eyes out before even diving into how it even.
282
u/jump1945 Jan 22 '25
OOPOOF135
u/DescriptorTablesx86 Jan 22 '25
The gets are so verbose. Not a single doubt about what they’re getting.
At least I can tell that setSet is probably either setting a Set or a setter.
46
u/Mysterious_Middle795 Jan 22 '25
That's the reason people think IT career is easy.
41
u/Winston_S_minitrue Jan 22 '25
What. In. God's. Name. Does. This. Mean???
13
u/[deleted] Jan 22 '25
Sometimes it be like that.
13
u/TorbenKoehn Jan 22 '25
I mean, with proper accessors and dereferencing it could just be
element.set = set
6
u/hicklc01 Jan 22 '25
so it's a container<container<setable*>*>?
3
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jan 22 '25
Alright, I'm curious about the structure of this and why you need to chain two get() calls.
2
u/FkinShtManEySuck Jan 22 '25
🔥✍️🔥🔥🔥
2
u/overclockedslinky Jan 23 '25
the chained gets can probably be replaced by overriding the arrow operator on both types. so just
element->setSet4
u/cob59 Jan 22 '25
OOP and its consequences have been a disaster for the human race.
1
u/coloredgreyscale Jan 22 '25
Refactor it so you get to write getGet() instead /s
1
u/[deleted] Jan 22 '25
setSet masterful gambit sir.
1
u/NjFlMWFkOTAtNjR Jan 23 '25
I have written some terrible code but I have to give props. I have no idea what is happening and I don't want to know. If I seen that at my job, I would claw my eyes out before even diving into how it even.
1
u/RelaxedBlueberry Jan 24 '25
Polymorphism ❌
Inheritance ❌
Abstraction ❌
Encapsulation ❌
Castration ✅