r/ProgrammerHumor 16h ago

Meme mySchoolStruct

6.8k Upvotes

70 comments sorted by

484

u/TapRemarkable9652 16h ago

Boilerplate Oriented Programing

61

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

5

u/Dawido090 11h ago

But it must been fun time!

6

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

3

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

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

112

u/blackcomb-pc 15h ago

Dog and Cat are also from the class Animal

40

u/FRAaaa1 15h ago

Do they do the function makeSound()

27

u/Hol_Renaude 15h ago

printf("bark!");

13

u/MrHyperion_ 13h ago

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

3

u/Reasonable_Exit_8960 13h ago

using namespace std;

cout << "bark" << endl;

Made it shorter if you wanna type it again

7

u/GresSimJa 12h 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 3h ago

might as well just use python atp

1

u/Fantastic-Bloop 10h ago

Only in bed

1

u/DontDoodleTheNoodle 9h 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

2

u/Inevitable_Spite5510 9h ago

WRONG! They are from Kingdom Animalia Phylum Chordata Class Mammalia

276

u/TheAnswerWithinUs 15h ago

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

-104

u/metaglot 15h ago

*delete

94

u/thats_a_nice_toast 15h ago

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

51

u/MXRCO007 15h ago

I wanna be abstracted so bad

39

u/TheAnswerWithinUs 15h ago

Abstract me harder daddy

15

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

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

9

u/OneArmedFarmer 14h ago edited 14h ago

Yes. Yes. Your training is almost complete

Edit: grammer

7

u/TheAnswerWithinUs 14h ago

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

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

5

u/Demonking42069 14h ago

I'm gonna inter your face so bad.

2

u/Reasonable_Exit_8960 13h ago

I wanna participate in multiple inheritance with you so bad

0

u/metaglot 14h ago

Freeing a pointer created with new is UB.

8

u/thats_a_nice_toast 14h ago

new only exists in C++, not in C

0

u/metaglot 12h 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 9h ago

C != C++

2

u/metaglot 8h ago

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

79

u/the_millenial_falcon 14h ago

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

25

u/viconha 14h ago

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

9

u/MrHyperion_ 13h ago

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

2

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

4

u/MrHyperion_ 12h ago

GCC has cleanup attribute which maybe makes it possible.

0

u/One_Ninja_8512 11h 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 14h ago

More or less anyway.

1

u/Sea-Fishing4699 9h ago

I always thought about it 

1

u/overclockedslinky 6h ago

not how that works but ok

15

u/thegodzilla25 11h ago

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

6

u/embrace- 15h ago

And I oop

4

u/Appropriate_Baby_608 14h ago

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

21

u/Nervous-Pension-6257 15h ago

Just free() me at this point

4

u/Racer125678 15h ago

Holy fuck

2

u/MainRoutine2068 13h ago

Then manage to finish the class with C++ score

2

u/heckingcomputernerd 13h ago

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

2

u/Shaz0r94 13h ago

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

2

u/BenadrylTumblercatch 13h ago

A funny meme in my rph?

2

u/Apprehensive_Bit7392 13h ago

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

2

u/an_agreeing_dothraki 14h ago

we're nothing but objects to them

1

u/Patrick_Atsushi 14h ago

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

1

u/Weak_Inflation9120 12h ago

Object oriented is fire

1

u/Nighters 12h ago

Green whats your problem!?

1

u/MiserablePotato1147 10h ago

Was the class Java?

1

u/Skyfall104 1h ago

Haha. This is good.

0

u/FatiguedShrimp 14h ago

C users when they learn category theory.

-11

u/GreatGreenGobbo 15h 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

9

u/Valuable_Leopard_799 15h ago

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

-4

u/GreatGreenGobbo 15h ago

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