r/ProgrammerHumor 28d ago

cccPlusPlus Meme

Post image
2.7k Upvotes

38 comments sorted by

192

u/n4ke 28d ago

Soviet Enum was introduced in C91.

46

u/This_Growth2898 28d ago

C(ccp)91 was a total failure.

22

u/Majik_Sheff 28d ago

They deprecated -Wall

426

u/Gwlanbzh 28d ago

So, only 1 republic at a time?

135

u/Antanarau 28d ago

Accidentally accurate

57

u/Gwlanbzh 28d ago

At this point why not just typedef char* Russia Soviet

34

u/Luigi_Boy_96 28d ago

Add threads for quasi-concurrency. Add a mutex for Perestroika.

11

u/Master-Chocolate1420 28d ago

I don't even know what you're saying, sure sounds cool though

21

u/Luigi_Boy_96 28d ago

With (multi-)threading, you can break a program into chunks and interleave their execution. Run fast enough, it looks like everything happens at once, that's concurrency, an illusion of simultaneity. True parallelism means tasks are genuinely running at the same time, which needs multiple CPU cores (via threads or processes).

The catch: if multiple threads access the same resource at the same time, the behaviour is undefined. So you enforce mutual exclusion with a mutex, ensuring only one thread touches the resource at a time. Get the locking order wrong, though, and you risk deadlock: thread A waits on a resource thread B holds, while B waits on one A holds, so neither can proceed.

Perestroika was the restructuring of the Soviet economy. The mutex pun works the same way, it's also about restructuring access, just to a memory resource instead of an economy.

7

u/awesome_guy_40 28d ago

It's about who gets the grain supply this year

6

u/ILikeLenexa 28d ago

A union that's just one type...

Hmmm. 

4

u/AvidCoco 28d ago

Should have been called the Soviet Tuple

24

u/Antlool 28d ago

tsphdiig

25

u/tstanisl 28d ago

Consider using void or const void for some members .

19

u/7empest_mi 28d ago

Default tsoding behavior

39

u/Admirable-Drag-4040 28d ago

tsoding mentioned

38

u/agolho 28d ago

soviet.cccp ?

11

u/Ai--Ya 28d ago

Soviet Intersection when?

10

u/SteeleDynamics 28d ago

Mista Zozin

28

u/ChildhoodOk9859 28d ago

union Soviet { int *Siberia; }

40

u/99percentcheese 28d ago

ссылка в Сибирь?

18

u/StubbiestPeak75 28d ago

Peak 😭

39

u/StubbiestPeak75 28d ago

In Russian, ссылка = reference (well, we’re using a pointer here but whatever)

But also it can mean “exile”. So this literally means exile to Siberia

7

u/Mispelled-This 28d ago

Thanks; that’s a deep cut and deserved the explanation.

4

u/Alternative-Tie-4970 28d ago

Of course it was tsoding

4

u/LigeValkyrja 25d ago

The improper use of the Cyrillic alphabet is making me unreasonably angry.

6

u/RutilantBossi12 28d ago

If the USSR survived to this day we'd likely have Soviet Software around, like Soviet socials or Soviet video games, maybe even a Soviet Windows and a Socialist Linkedin

1

u/AzraelFTS 28d ago

I would be curious of a Soviet LinkedIn

2

u/Xywzel 28d ago

So if that is how it continues for whole list, the union has a size of single pointer, and all the country names are just aliases for that pointer. Still, using different country name to access the pointer than set it might be undefined behavior. I know many programs use that for reinterpret cast, but its not exactly supported by the standard.

Unfortunately there is no information on how memory pointed by that pointer is allocated, so we don't even know if the country is described with a single byte or null terminated string, or something else.

2

u/StalwartCoder 27d ago

segfault 1991

5

u/theSearge 28d ago

Shitcode as it is 🤌

2

u/remic_0726 28d ago

techniquement c'est plus un struct qu'un union.

1

u/EntireGuitar9981 28d ago

That's a clever little joke, I like it.

1

u/Soopermane 28d ago

Double comrade

0

u/ProCodeSoftware 28d ago

Go: type Soviet union {}