YandereDev's Code

How can one's code be so bad?
also get

How would you solve it?

cucked

How can one's digits be so bad?

use enums instead of raw strings

Seems readable and maintainable. What's the problem?

Hashmap

hes not using git control

Best get goes to

Use strategy patern.
each else if witnessed will become separate subclass in separate file and you will only have to call one function.
if (!this.WitnessedCorpse) {
this.Witnessed()
}

Is he done milking it yet?... No, of course not.

enum, also hashmap lookup unstead of sequencial check

1. the guy is not skilled at programming and this has been established many times and he has a low willingness to learn.
2. that code snapshot is from a C# decompiler and not actual source code.
3. if you insist on making this thread over and over at least use a new picture.

Or better yet, associate each this.Witnessed with a label and a cause, and simply iterate until you find the one you want. Quite more readable, maintainable and extensible.
// I don't know whether this is JS, probably not
for (var wit : witnessed) {
if (this.Witnessed == wit.name) {
this.Subtitle.UpdateLabel(wit.label, 1, (float)6);
this.GameOverCause = wit.cause;
break;
}
}

bit field
switch case
enum

The same logic can be written using a much smaller amount of statements, which is 100% making it harder to read and maintain.
String values are used for storing state where it clearly should be done using boolean values, which is not a crime, but is incorrect, and makes it easier to make a mistake.

It's C#.

this is for use with Unity so using strings for state is fine because the code is being read in conjunction with a full GUI program. Still though, you should not be using string literals, that's just bad practice. Same reason why you don't use magic numbers but even more so.

It's not bad code until you can rewrite it in a better format

I honestly hope you're not saying that it's a good practice to use the same value for both state and the text displayed to user.

did you come up with that one yourself? lol

there is nothing inherently wrong with it. On a related note if you have a unique state for every message displayed to the user you are probably doing something wrong.

You see no possible issues with, for example, localization?

...

step 1: download "debug" build from website
step 2: use ilspy or dotpeek
step 3: laugh

>that code snapshot is from a C# decompiler and not actual source code.
This. Everybody else itt is a brainlet.