r/ProgrammerHumor • • Oct 26 '26

Meme bushido

Post image
1.5k Upvotes

28 comments sorted by

63

u/Successful-County640 Oct 26 '26

Since I learnt game dev I am able to understand this sub's memes better, before I didn't get much of it.

25

u/P_kyuu_juu Oct 26 '26

Yeah, this one is just for the Unity developers

27

u/WernerderChamp Oct 26 '26

Each codebase has a few of these comment gems. Remember to add your own when the time is right.

11

u/eskay8 Oct 27 '26

AI can't replace this

6

u/binhosuaid Oct 27 '26

Btw, if Im not mistaken, this line of code Destroys only the component, intead of the whole gameObject. Got stumped on this a long time agoq

3

u/L4t3xs Oct 27 '26

Yeah and if I remember correctly there might be some other issues as well with this implementation.

1

u/P_kyuu_juu Oct 27 '26 edited Oct 27 '26

Yeah, if an active component gets destroyed then its OnDisable gets called first, so then there are two Destroy() calls for that component. It wouldn't break anything but there are cleaner ways of doing this.

1

u/MehPropy Oct 27 '26

wouldn't it run a recursive loop of calling ondisable because destroy Is constantly called

1

u/P_kyuu_juu Oct 27 '26

No, it would just give a null reference error on the second Destroy() attempt.
The Destroy() function disables the object or component first, which is what triggers the OnDisable(). On the second Destroy() call the object will already be inactive.

1

u/P_kyuu_juu Oct 27 '26

Yea, Destroy( gameObject ); and Destroy( this ); are not the same lol

243

u/Banana_Twinkie Oct 26 '26

git commit -seppuku

33

u/Blood_and_Wine Oct 26 '26

git push -u origin belly

31

u/_dotdot11 Oct 26 '26

"Unrecognized positional argument 'eppuku'"

5

u/zthe0 Oct 27 '26

--seppuku

4

u/SuicidePig Oct 27 '26

git pull trigger

32

u/Highborn_Hellest Oct 26 '26

the bulshido is strong with this one.

31

u/markiel55 Oct 27 '26

delete this 🔫

8

u/Soccatin Oct 27 '26

I got to write 'delete this' seriously in a project for the first time last week. I'm still high off it

6

u/N0t_my_0ther_account Oct 27 '26

Ahh, a Unity dev

4

u/BarrelRollxx Oct 27 '26

You'll need a null check there bud

2

u/JackNotOLantern 28d ago

I remember when for some studies project i wrote in c++ delete this;

1

u/thafuq Oct 27 '26

It has some 1940 germany vibes too

1

u/Last8Exile Oct 27 '26

Scary thing is you may disable some gameobject in a editor to test something and random component deep in the three will delete itself.

1

u/J-Dizzle00 29d ago

Bushido? Bushido muss gar nichts mehr

1

u/TheTybera 26d ago

// Patricide
Destroy( this.transform.parent )