i tried to do "generics" and "classes" in C and it's ended up on writing custom language to translate Java-like code into BOP lmao, a lot of time has been wasted
What the absolute fuck I literally just had a class about this. Guess it stands to reason since this subreddit is mostly student humor we’d all be learning similar things at similar times of the year
The comment suggested that they use free, which i corrected because in c++ thats UB (which it must be if they are being put into a class, otherwise whats there to free?)
Also the destructor won't get automatically called when the "object" goes out of scope. Someone correct me if I'm wrong, but I believe that behavior is theoretically impossible to achieve in C (due to its limited mechanics)?
Not only possible but used by real projects. Apparently systemd is using that according to Claude. Both GCC and Clang support it. If I wanted destructors I'd go with explicit reference counting though, that seems more clean to me and doesn't need compiler extensions (even though both mainstream ones support it and a large project (systemd) relies on it).
662
u/TapRemarkable9652 Sep 11 '26
Boilerplate Oriented Programing
157
u/blackcomb-pc Sep 11 '26
Dog and Cat are also from the class Animal
322
u/TheAnswerWithinUs Sep 11 '26
The horrors, might as well just free() yourself at that point.
32
u/thegodzilla25 Sep 11 '26
An original funny meme that is not AI or div centering in this sub? The horror
112
u/the_millenial_falcon Sep 11 '26
Pro tip, if you put function pointers in a struct you have a class now.
12
u/Celemourn Sep 11 '26
lol
10
u/embrace- Sep 11 '26
And I oop
21
u/Nervous-Pension-6257 Sep 11 '26
Just free() me at this point
7
u/Appropriate_Baby_608 Sep 11 '26
"so we will be using notepad.. no like real notepad... like pan and paper notepad"
7
u/MainRoutine2068 Sep 11 '26 •
Then manage to finish the class with C++ score
6
u/Racer125678 Sep 11 '26
Holy fuck
4
u/jackfinch69 Sep 11 '26
u/savevideobot
4
u/yellowmiami Sep 12 '26
I feel like C would especially hate music class with all those string instruments lying around.
3
u/Shaz0r94 Sep 11 '26
Something something linux users being allergic to sunlight (They hate windows)
3
u/Apprehensive_Bit7392 Sep 11 '26
Struct. You were put in a struct. There were never any classes here.
2
u/heckingcomputernerd Sep 11 '26
Java users celebrating getting into uni (they were put in a class)
2
u/BenadrylTumblercatch Sep 11 '26
A funny meme in my rph?
2
u/cereal-at-noon Sep 12 '26
Actually funny lol
2
u/an_agreeing_dothraki Sep 11 '26
we're nothing but objects to them
1
u/Patrick_Atsushi Sep 11 '26
And they feel a lot better when they know it's structured.
1
u/Liarus_ Sep 11 '26
u/savevideobot
1
u/Makonede Sep 11 '26
u/SaveVideo
1
u/Nighters Sep 11 '26
Green whats your problem!?
1
u/Fantastic-Bloop Sep 11 '26
u/savevideo
1
u/Gabriel_Science Sep 11 '26
u/savevideo
1
u/Skyfall104 Sep 12 '26
Haha. This is good.
1
u/yuehuang Sep 12 '26
Make friends, Not enum-ies.
1
u/Asmophel_noe Sep 12 '26
Go too
1
u/FitCollar1161 Sep 13 '26
Is this sub back??
1
u/Sakul_the_one Sep 13 '26
I got accepted this year into uni...
0
u/FatiguedShrimp Sep 11 '26
C users when they learn category theory.
-13
u/GreatGreenGobbo Sep 11 '26
I mentioned this in another post.
High school I learned Pascal and C.
Graduated 92 went to university. CS101 (programming) - Scheme
0
u/[deleted] Sep 11 '26
[deleted] — view deleted comment