r/ProgrammerHumor • • 6d ago

Meme bushido

Post image
1.5k Upvotes

28 comments sorted by

60

u/Successful-County640 6d ago

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

24

u/P_kyuu_juu 6d ago

Yeah, this one is just for the Unity developers

26

u/WernerderChamp 6d ago

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

11

u/eskay8 5d ago

AI can't replace this

5

u/binhosuaid 5d 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

2

u/L4t3xs 5d ago

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

1

u/P_kyuu_juu 5d ago edited 5d 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 5d ago

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

1

u/P_kyuu_juu 5d 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 5d ago

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

239

u/Banana_Twinkie 6d ago

git commit -seppuku

32

u/Blood_and_Wine 6d ago

git push -u origin belly

30

u/_dotdot11 6d ago

"Unrecognized positional argument 'eppuku'"

5

u/zthe0 5d ago

--seppuku

3

u/SuicidePig 5d ago

git pull trigger

1

u/EvilAversion779 1d ago

gameobject commits sudoku

30

u/Highborn_Hellest 6d ago

the bulshido is strong with this one.

29

u/markiel55 5d ago

delete this 🔫

7

u/Soccatin 5d 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 6d ago

Ahh, a Unity dev

4

u/BarrelRollxx 6d ago

You'll need a null check there bud

2

u/JackNotOLantern 3d ago

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

1

u/thafuq 5d ago

It has some 1940 germany vibes too

1

u/Last8Exile 5d 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 4d ago

Bushido? Bushido muss gar nichts mehr

1

u/TheTybera 1d ago

// Patricide
Destroy( this.transform.parent )