war crimes in programming - A thread to discuss and share horrifying programming ideas/code

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
I knew one guy who went insane because he had oneitis for someone named Valeria and they went by Val but he decided to go into programmimg for some reason. Idk what happened to him after that, but I would like to be a fly on the wall this time if he has to learn about the programming language Val.
 
How can you mention a programming war crime without bringing up YandereDev?
isnt it something like 30k+ lines for just the code for students and it's just an if else statement nightmare

Just a reminder, if you think those case statements as the beginning of video 2 are bad. I'll remind people that the entirety of Undertale's dialogue is written in a single case statement that goes for 3,000 lines.
1730775513396.png
 
Just a reminder, if you think those case statements as the beginning of video 2 are bad. I'll remind people that the entirety of Undertale's dialogue is written in a single case statement that goes for 3,000 lines.
Toby Fox is a good game developer, but not a good programmer.
 
Here's some obtuse ways of writing "Hello World" to the C# console.
C#:
class Program {
    static void Main(string[] args) {
        if (System.Console.OpenStandardOutput()
            .BeginWrite(new byte[] { 072, 101, 108, 108, 111, 032, 087, 111, 114, 108, 100, 033 },
                        0, 12, null, null)
            .AsyncWaitHandle.WaitOne()) { }
        if (System.Console.ReadKey().Modifiers == 0) { }
    }
}

This guy's taken it even further
 
Here's some obtuse ways of writing "Hello World" to the C# console.
C#:
class Program {
    static void Main(string[] args) {
        if (System.Console.OpenStandardOutput()
            .BeginWrite(new byte[] { 072, 101, 108, 108, 111, 032, 087, 111, 114, 108, 100, 033 },
                        0, 12, null, null)
            .AsyncWaitHandle.WaitOne()) { }
        if (System.Console.ReadKey().Modifiers == 0) { }
    }
}

This guy's taken it even further
That's nothing. Check this out: https://github.com/Hello-World-EE/Java-Hello-World-Enterprise-Edition
1730802173770.png
 
Just a reminder, if you think those case statements as the beginning of video 2 are bad. I'll remind people that the entirety of Undertale's dialogue is written in a single case statement that goes for 3,000 lines.
It's not completely terrible (unlike Undertale). It's in one place, like it would be in a normal resource file (although I wouldn't hate a state machine with every room being a class, and per-room dialogue), and he made a markup microlanguage for text effects.

The worst thing is how he goes about setting the values.
Apparently msg is an array with the length equal to the longest line count in a scene, across all scenes (!), that needs to be maintained (maybe he's set it to a safe value, like 1000).
For every scene, he rewrites part of the array, and ends the last line of the scene with %% to stop iteration. The rest just dangle like an estrogenated dick.
The lines in each set are numbered manually: if he inserts a line, he has to renumber later lines; if he appends or deletes a line to/from the end, he has to remember to move the %%.
 
Lolcows and indians create Godless code from time to time. Although learning through examples of what not to do isn't very productive, people like gawking all the same.

YandereDev's student script is 27K lines long. (27000/(365*11) = Six lines of code a day. Forget about decoupling or reusing logic, he has it all in one place!
If he wasn't a two-time teen talker and could code competently, people would respect him since he's enduring.
I remember a highlight where someone read over a line of code where a student, upon seeing suspicious behaviour, would become a teacher for a single frame. Whatever Alex wanted the student to do as "a teacher" during the next update is lost to time.

Personally, I find Maldavius/Jason Thor Hall/PirateSoftware creating bad code more interesting and dramatic since he brags about being a sophisticated hacker/blizzard coder/social engineer.
1725447138929.png1723279593007.png
Explanation by @Soyjak Enjoyer:

Just to try to give an idea of what he is doing here for people who can't read code, it appears that every story decision is represented by an arbitrary number at an arbitrary location in a big list. The repetitive copy-pasted lines are bad and easily fixable, but small potatoes. This is really bad because it means if for example, you need to check later whether or not the player chose the hot coffee 5 hours ago in the story (idk why this would have an impact far into the story but it's just for example), he would have by then forgot what the number codes are and have to cross reference this file and ctrl+f to find what specific numbers correspond to this option and the type something along the lines of:

if(global.story_array[216] == 2)

and then later on if he's changing something and comes across that line he'll have no idea what the fuck "216" and "2" refer to and have to cross-reference the file again to figure out what. Unless he comments every single time he invokes something from this array to explain what it is to himself, but then if he accidentally typed 204 instead of 205 that would create a potentially very difficult-to-find bug that would waste a lot of his time. And since it's all just hard constants
With under 2 hours of upfront work, he could've designed it such that he instead typed something much easier to work with like:

if(global.story_map["CoffeeTemperature"].equals("hot"))
or even something like
if(global.StoryDecisions.COFFEE_HOT)

and those are just generic approaches I don't know the specifics of how his game works so there may be an even better way

When you're working by yourself on a small project it's perfectly reasonable or sometimes even a timesaver if the scope is small enough to engage in some bad practice shit like this, but when he has hundreds of lines in this file, possibly thousands, all that time spent on the cross-referencing and the potential to lose focus while changing and scrolling around in different files will add up. From Yanderedev I understand it, from L33t "ex-blizzard" h4x0r man, it's just pathetic
Could you imagine fat-fingering the incorrect number and inputting the wrong array index for some random story beat that gets saved into memory? Since this is a singleton, that little error can be anywhere! Figuring out why something isn't happening the way it should would be hell!
 
Last edited:
Back