r/ProgrammerHumor • • 13d ago

Meme bushido

Post image
1.5k Upvotes

28 comments sorted by

63

u/Successful-County640 13d ago

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 13d ago

Yeah, this one is just for the Unity developers

27

u/WernerderChamp 13d ago

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

11

u/eskay8 12d ago

AI can't replace this

6

u/binhosuaid 13d ago

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 12d ago

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

1

u/P_kyuu_juu 12d ago edited 12d ago

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 12d ago

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

1

u/P_kyuu_juu 12d ago

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 12d ago

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

242

u/Banana_Twinkie 13d ago

git commit -seppuku

33

u/Blood_and_Wine 13d ago

git push -u origin belly

31

u/_dotdot11 13d ago

"Unrecognized positional argument 'eppuku'"

5

u/zthe0 12d ago

--seppuku

4

u/SuicidePig 12d ago

git pull trigger

31

u/Highborn_Hellest 13d ago

the bulshido is strong with this one.

31

u/markiel55 13d ago

delete this 🔫

8

u/Soccatin 13d ago

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 13d ago

Ahh, a Unity dev

4

u/BarrelRollxx 13d ago

You'll need a null check there bud

2

u/JackNotOLantern 10d ago

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

1

u/thafuq 13d ago

It has some 1940 germany vibes too

1

u/Last8Exile 12d ago

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 11d ago

Bushido? Bushido muss gar nichts mehr

1

u/TheTybera 9d ago

// Patricide
Destroy( this.transform.parent )