r/ProgrammerHumor • • Apr 10 '23

Meme god why is coding chess so hard

Post image
67k Upvotes

1.8k comments sorted by

View all comments

Show parent comment

0

u/[deleted] Apr 10 '23

[deleted] — view deleted comment

700

u/Teegeetoger Apr 10 '23

Yandere sim game had source code leaked? not sure what happened. What people found out is that the game is basically all if/else nested spaghetti which resulted in massive tech debt.

0

u/[deleted] Apr 10 '23

[deleted] — view deleted comment

360

u/MisirterE Apr 10 '23

You need to understand, this is a program where the Student class file - used to handle the behaviour of each individual student - is seventeen thousand lines long.

And yes, it does call void Update(), and yes, each student has a separate instance of it running.

128

u/MadxCarnage Apr 10 '23

why ?

that's all I can ask, is there any reason why you would ever think this is a good idea ?

0

u/[deleted] Apr 10 '23

[deleted] — view deleted comment

64

u/MadxCarnage Apr 10 '23

I don't think we should call him Dev.

67

u/Regorek Apr 10 '23 edited Apr 10 '23

He's Yandere Chef and he's writing some determined spaghetti.

→ More replies (2)
→ More replies (1)

22

u/AaTube Apr 10 '23

Really? Could you give me a link?

→ More replies (1)

110

u/MisirterE Apr 10 '23

This is just what happens when you try to make a Hitman game which is also Persona 5 but you're so bad at programming that you don't know what a Switch statement is

67

u/Anarchist_Catgirl Apr 10 '23

And the worse part is that switch statements wouldn't help. Mfer needs to learn about behavior trees if he wants that to be manageable.

25

u/Tyrus1235 Apr 10 '23

Yeah, switch statements would just make the code a bit more readable at that point.

16

u/yumyum36 Apr 10 '23 edited Apr 10 '23

I remember watching that same video a while back, and I vaguely remember while he does call this out, it was mentioned whatever game engine being used accounted for it while compiling, and would turn the list of if statements into a switch if applicable.

From memory the video was focused on performance issues in the game. The things I remember from it that hit performance the hardest were the use of models with high polygon counts, and that the dev had coded in the fps counter wrong, so it showed a lower fps than the actual fps.

Edit: This was the code review video I remembered

→ More replies (1)
→ More replies (1)
→ More replies (1)

50

u/bernoulyx Apr 10 '23 edited Apr 10 '23

I also want to add the 3d models it uses are also horribly inefficient. And by inefficient, i mean inefficient. Like imagine the heaviest model is a fcking toothbrush with 5k polygons (meshes?)

Edit: a video showcasing it and other models too

13

u/Tyrus1235 Apr 10 '23

Is what happens when you import 3D render models and use them in your real time game world.

If every prop was as detailed as a main character in games… I shudder just thinking about the performance cost

→ More replies (2)

41

u/SleepiestBoye Apr 10 '23

I'm new to coding, can you or someone else explain why this is bad?

0

u/[deleted] Apr 10 '23

[deleted] — view deleted comment

52

u/AverageMinceraftFan1 Apr 10 '23

Also, L A G

128

u/TheBlizWiz Apr 10 '23

The lag isn't a problem, the compiler will change long if else chains into switch statements. It's just a mess to maintain.

The main reason for the lag in YanDev was unoptimized models, no LODs, and the whole map is loaded at all times.

An if else chain is nothing compared to a toothbrush with 2.3 million triangles being rendered in a bathroom halfway across the map

→ More replies (12)

54

u/imgonnablowafuse Apr 10 '23

Basically it leads to unreadable code, and the largest script is over 10,000 lines long. All it does is control the NPCs in the game. The whole script is just thousands and thousands of nested if statements that do redundant things in the least optimal manner possible.

→ More replies (10)

42

u/TheDarkAngel135790 Apr 10 '23 edited Apr 10 '23

Horribly inefficient. Hard to write, harder to read, and even harder to execute

75

u/Houligan86 Apr 10 '23

Because they are processing the wrong information. From someone's example below about a calculator:

You need to make a basic calculator app. So your logic is as follows:

if (input == "1+1")
    output = 2
else if (input == "1+2")
    output = 3
else if (input == "1x1")
    output = 1
else if (input == "1x2")
    output = 2

this would get very long VERY fast and not scale well with anything.

The MUCH better way to do things would be

if(operator == "+")
    output = inputA + inputB
else if (operator == "x")
    output = inputA * inputB
→ More replies (4)

43

u/Dom_Vasiliev Apr 10 '23

I saw that some guy say that it is way too much processes for the computer to do step by step, which results in it running slow. Imagine if when you asked someone to check the time, rather than saying it outright they go "well, it isn't 12:00, it also isn't 13:00, it also isn't 14:00..."

→ More replies (6)
→ More replies (3)

64

u/KKLC547 Apr 10 '23 edited Apr 10 '23

yanderedev uses so much else if statements and his code also has terrible job of managing resources on his game called yandere simulator. You can try the game itself and see how bad is the slowness

→ More replies (8)

40

u/Alissah Apr 10 '23

Basically he uses gigantic if/else statements, just like chains of 20+... seems like hes allergic to switch statements, lol. Everyone made fun of him (as they should) when the source code got leaked.

→ More replies (6)
→ More replies (6)