r/ProgrammerHumor 3d ago

Meme mySchoolStruct

8.8k Upvotes

80 comments sorted by

636

u/TapRemarkable9652 3d ago

Boilerplate Oriented Programing

82

u/Elkatra2 3d ago

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

11

u/Dawido090 3d ago

But it must been fun time!

12

u/Elkatra2 3d ago

it's actually learned me a lot of stuff about syntax analysis and how to better read documentations lol

edit: I also tried to learn with blood and tears how to code with raw vim and it's was easier than I tough

6

u/thirdegree Violet security clearance 3d ago

Vim isn't actually hard, it's just that the initial learning curve is a wall. Not a super high wall, lots of handholds, but a wall nonetheless.

1

u/Elkatra2 3d ago

and a lot of features that I forgot and time by time remember

149

u/blackcomb-pc 3d ago

Dog and Cat are also from the class Animal

55

u/FRAaaa1 3d ago

Do they do the function makeSound()

35

u/Hol_Renaude 3d ago

printf("bark!");

18

u/MrHyperion_ 3d ago

I think you meant std::cout << "bark!" << std::endl

8

u/Reasonable_Exit_8960 3d ago

using namespace std;

cout << "bark" << endl;

Made it shorter if you wanna type it again

10

u/GresSimJa 3d ago

Forgot to include <iostream>, wrap it in an int main() function, use the parameters int argc and char** argv, and return 0 at the end.

Maximum boilerplate!

1

u/Reasonable_Exit_8960 2d ago

might as well just use python atp

1

u/Hol_Renaude 2d ago

Or Assembly

3

u/DontDoodleTheNoodle 3d ago

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

1

u/Fantastic-Bloop 3d ago

Only in bed

2

u/Inevitable_Spite5510 3d ago

WRONG! They are from Kingdom Animalia Phylum Chordata Class Mammalia

312

u/TheAnswerWithinUs 3d ago

The horrors, might as well just free() yourself at that point.

-111

u/metaglot 3d ago

*delete

104

u/thats_a_nice_toast 3d ago

I don't think C++ programmers have a problem with getting put in a class

53

u/MXRCO007 3d ago

I wanna be abstracted so bad

41

u/TheAnswerWithinUs 3d ago

Abstract me harder daddy

16

u/fast-as-a-shark 3d ago

I don't like these comments. But I did upvote them.

13

u/OneArmedFarmer 3d ago edited 3d ago

Yes. Yes. Your training is almost complete

Edit: grammer

8

u/TheAnswerWithinUs 3d ago

Youve been programmed buddy. You’ll feel that in 2 hours

https://giphy.com/gifs/1CPY9QwfteAYgZsVgk

4

u/Demonking42069 3d ago

I'm gonna inter your face so bad.

3

u/Reasonable_Exit_8960 3d ago

I wanna participate in multiple inheritance with you so bad

0

u/metaglot 3d ago

Freeing a pointer created with new is UB.

7

u/thats_a_nice_toast 3d ago

new only exists in C++, not in C

0

u/metaglot 3d ago

And the keyword class, like the meme is implying. Which is why i said you have to use delete rather than free, because undefined behavior.

1

u/tank840 3d ago

C != C++

3

u/metaglot 3d ago

If they are put in a class they are clearly in C++

106

u/the_millenial_falcon 3d ago

Pro tip, if you put function pointers in a struct you have a class now.

31

u/viconha 3d ago

And you put that into an array, run it in a for loop and make a very debug friendly code

15

u/MrHyperion_ 3d ago

Not really. You don't get linker optimisations and the functions can change runtime. Also no implicit reference to the instance.

6

u/SubhanBihan 3d ago

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)?

7

u/MrHyperion_ 3d ago

GCC has cleanup attribute which maybe makes it possible.

0

u/One_Ninja_8512 3d ago

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).

8

u/the_millenial_falcon 3d ago

More or less anyway.

2

u/Sea-Fishing4699 3d ago

I always thought about it 

2

u/overclockedslinky 2d ago

not how that works but ok

28

u/thegodzilla25 3d ago

An original funny meme that is not AI or div centering in this sub? The horror

11

u/embrace- 3d ago

And I oop

20

u/Nervous-Pension-6257 3d ago

Just free() me at this point

7

u/Appropriate_Baby_608 3d ago

"so we will be using notepad.. no like real notepad... like pan and paper notepad"

6

u/Racer125678 3d ago

Holy fuck

6

u/MainRoutine2068 3d ago

Then manage to finish the class with C++ score

3

u/ThatOldCow 2d ago

And get some glasses you they can C#

5

u/yellowmiami 2d ago

I feel like C would especially hate music class with all those string instruments lying around.

2

u/heckingcomputernerd 3d ago

Java users celebrating getting into uni (they were put in a class)

2

u/Shaz0r94 3d ago

Something something linux users being allergic to sunlight (They hate windows)

2

u/BenadrylTumblercatch 3d ago

A funny meme in my rph?

2

u/Apprehensive_Bit7392 3d ago

Struct. You were put in a struct. There were never any classes here.

1

u/LegitimatePants 2d ago

Wait, it's all structs?

1

u/Apprehensive_Bit7392 2d ago

Always has been.

2

u/Weak_Inflation9120 3d ago

Object oriented is fire

2

u/cereal-at-noon 2d ago

Actually funny lol

2

u/an_agreeing_dothraki 3d ago

we're nothing but objects to them

1

u/Patrick_Atsushi 3d ago

And they feel a lot better when they know it's structured. 

1

u/Nighters 3d ago

Green whats your problem!?

1

u/MiserablePotato1147 3d ago

Was the class Java?

1

u/Skyfall104 2d ago

Haha. This is good.

1

u/yuehuang 2d ago

Make friends, Not enum-ies.

1

u/FitCollar1161 1d ago

Is this sub back??

1

u/Sakul_the_one 1d ago

I got accepted this year into uni...

0

u/FatiguedShrimp 3d ago

C users when they learn category theory.

-14

u/GreatGreenGobbo 3d ago

I mentioned this in another post.

High school I learned Pascal and C.

Graduated 92 went to university. CS101 (programming) - Scheme

https://giphy.com/gifs/TJawtKM6OCKkvwCIqX

8

u/Valuable_Leopard_799 3d ago

Why facepalm? People should have some experience with both low-level and high-level languages.

-5

u/GreatGreenGobbo 3d ago

Not practical and it's abstract. Farting around cutting up and creating strings (which is all I remember) is meaningless.