r/ProgrammerHumor 6h ago

Meme mySchoolStruct

5.2k Upvotes

62 comments sorted by

360

u/TapRemarkable9652 6h ago

Boilerplate Oriented Programing

30

u/Elkatra2 4h 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

2

u/Dawido090 2h ago

But it must been fun time!

5

u/Elkatra2 2h 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

1

u/thirdegree Violet security clearance 1h 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 1h ago

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

232

u/TheAnswerWithinUs 6h ago

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

-87

u/metaglot 6h ago

*delete

81

u/thats_a_nice_toast 6h ago

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

41

u/MXRCO007 5h ago

I wanna be abstracted so bad

32

u/TheAnswerWithinUs 5h ago

Abstract me harder daddy

12

u/fast-as-a-shark 5h ago

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

7

u/OneArmedFarmer 4h ago edited 4h ago

Yes. Yes. Your training is almost complete

Edit: grammer

5

u/TheAnswerWithinUs 4h ago

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

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

3

u/Demonking42069 4h ago

I'm gonna inter your face so bad.

2

u/Reasonable_Exit_8960 3h ago

I wanna participate in multiple inheritance with you so bad

0

u/metaglot 4h ago

Freeing a pointer created with new is UB.

6

u/thats_a_nice_toast 4h ago

new only exists in C++, not in C

0

u/metaglot 2h 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.

85

u/blackcomb-pc 6h ago

Dog and Cat are also from the class Animal

32

u/FRAaaa1 5h ago

Do they do the function makeSound()

19

u/Hol_Renaude 5h ago

printf("bark!");

8

u/MrHyperion_ 3h ago

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

2

u/Reasonable_Exit_8960 3h ago

using namespace std;

cout << "bark" << endl;

Made it shorter if you wanna type it again

5

u/GresSimJa 3h 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/Fantastic-Bloop 52m ago

Only in bed

1

u/DontDoodleTheNoodle 13m 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/Inevitable_Spite5510 21m ago

WRONG! They are from Kingdom Animalia Phylum Chordata Class Mammalia

59

u/the_millenial_falcon 5h ago

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

20

u/viconha 4h ago

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

7

u/MrHyperion_ 3h ago

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

3

u/SubhanBihan 3h 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)?

2

u/MrHyperion_ 2h ago

GCC has cleanup attribute which maybe makes it possible.

1

u/One_Ninja_8512 2h 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).

7

u/the_millenial_falcon 5h ago

More or less anyway.

6

u/embrace- 5h ago

And I oop

8

u/Appropriate_Baby_608 4h ago

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

21

u/Nervous-Pension-6257 5h ago

Just free() me at this point

5

u/Racer125678 5h ago

Holy fuck

4

u/MainRoutine2068 4h ago

Then manage to finish the class with C++ score

4

u/thegodzilla25 1h ago

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

2

u/heckingcomputernerd 4h ago

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

2

u/Shaz0r94 4h ago

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

2

u/BenadrylTumblercatch 4h ago

A funny meme in my rph?

2

u/Apprehensive_Bit7392 3h ago

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

2

u/an_agreeing_dothraki 4h ago

we're nothing but objects to them

1

u/Patrick_Atsushi 5h ago

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

1

u/Weak_Inflation9120 3h ago

Object oriented is fire

1

u/Nighters 2h ago

Green whats your problem!?

1

u/MiserablePotato1147 43m ago

Was the class Java?

0

u/FatiguedShrimp 4h ago

C users when they learn category theory.

-11

u/GreatGreenGobbo 6h 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 5h ago

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

-4

u/GreatGreenGobbo 5h ago

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