Some people have pointed out that ~8:10 is incorrect, and I wanted to say that yeah, it is- these if statements won't run each check individually because each case is a return. I was chiefly trying to explain how those if chains work fundamentally, and forgot to mention that the specific case shown isn't going to work the same way because of the aforementioned returns. Sorry about the slip up! If I can get a chunk of the code again, I'll try to do another version that's scripted and so on so I can avoid those sorts of in-the-moment errors. Again, sorry 'bout that! Continue at your viewing leisure :) PS: Still not entirely sure why they're if chains instead of else if chains? Weird.
@onee-sama4 жыл бұрын
The main issue with the code that YanDev writes is that there has been no effort put in to the architecture of the code at all. Any decent programmer would start breaking code up in to different files, classes, etc. far before their file became even 1000 lines long instead of having a single method be an entire 8000 lines long. Additionally, anyone with a basic understanding of computer architecture would understand how bad it is to run this many conditional statements every single frame due to how the CPU pipeline works. Simply put, the CPU will try to predict which piece of code is going to run next and begin processing code in those paths before they're executed, however if the CPU predicts incorrectly then a pipeline stall occurs in which the CPU will throw out all the work it did and start down the actual code path that was hit (this is what commonly causes stuttering or freezing) and when you have so many potential code paths that can be taken every frame then multiply that by the number of students the failure rate becomes extremely high. YanDev is a hack.
@slakkenhuisdeur4 жыл бұрын
I'm guessing the compiler removed the `else` because the control flow only leaves the chosen branch to the caller, so it doesn't matter if the `else` statement is or isn't present. While typing this I got another idea: because the function returns inside the `if`'s, the decompiler couldn't reconstruct it to an `if else` construct. The `if (!false) return ...; return ...` at that timestamp is also an interesting construct...
@nuclearsummer77964 жыл бұрын
The one thing I noticed out of this entire videos is the SS13 bookmark. All I have to say is "Ahh a man of somewhat questionable culture"
@GrzesiuG444 жыл бұрын
Meanwhile me as c++ dev: "wait, this didn't compile into a lookup table? must be a compiler bug".
@slakkenhuisdeur4 жыл бұрын
@Tudi20 A switch would indeed be better for readability, but I don't think a dictionary would be proper here. All possible values are known at compile time, so using a dictionary would only add overhead. If you want to make it possible for mods to add new students a dictionary would be necessary, but I think we both know how YD thinks about mods...
@CariagaXIII4 жыл бұрын
the only game where a debunk page is made by the same developer who hasn't finished the game
@mcplumpkin61914 жыл бұрын
the fact that he needs an entire debunk page is hilarious
@nunuri78944 жыл бұрын
The best thing about that page is that the internet has proof of all of those claims being true
@seauqis4 жыл бұрын
I read it and i felt like i was losing braincells
@dedgect4 жыл бұрын
Yanderedev investigated yanderedev and found out that yanderedev did nothing wrong
@mcplumpkin61914 жыл бұрын
@@dedgect that's enough proof he's innocent 👍
@CliveGlitch4 жыл бұрын
He wrote all of this debunk page instead of working on the game.
@jhonvvick12894 жыл бұрын
How ironic
@DoomRater4 жыл бұрын
I get it though. Some people just get super pissed and need to vent, like a friend of mine who drew some Peach and Rosalina slash and people accused her of drawing incest even though canonically the characters are not related in the slightest... I bet she spent 6 hours writing up that rebuttal
@jhonvvick12894 жыл бұрын
@@DoomRater you dont know this guy do you?
@DoomRater4 жыл бұрын
@@jhonvvick1289 I can imagine his reasoning for pushing back against claims against him, even if he's 100% in the wrong. And I've seen far worse snippets of code than what's been shown here, so I have no doubts he has no idea the kind of headaches he's setting himself up for writing code like this.
@WARUEL4 жыл бұрын
If he doesn't do that. He will lose more money.
@imdefinitelynotkyle4 жыл бұрын
An old adage comes to mind: "A good blacksmith never blames his tools for a dull sword."
@LuisRamirez-ss3ki4 жыл бұрын
Where’s that from? Its a great adage
@archiveacc32484 жыл бұрын
@@LuisRamirez-ss3ki good blacksmiths probably
@oBlueElement4 жыл бұрын
@@archiveacc3248 😂😂😂
@_________________4043 жыл бұрын
Now you see why chrome using "too much ram" is most of the time just a fault of people like this guy, who write horrible javascript which then causes the large ram consumption.
@lazerpie101_A2 ай бұрын
@@_________________404 ok, while bad web page design is an issue, you must also understand that the internet is an ungodly abomination that made the absolute worst choice when it comes to every aspect of its design. (also chrome _is_ a pile of garbage)
@Driver-qt9jh4 жыл бұрын
I'm going to say this from someone else's experience: yandev take a lot of models for the internet, which in it's self isn't bad. The problem is, those models are about 500x more detailed than they need to be! This is because most are not supposed to be used for games. This means, at one point, the biggest model polygon wise was A TOOTH BRUSH.
@enderspectre46074 жыл бұрын
Yeah, but what he said about the assets is true. Programmers will use other assets to test their code. What your upset about is he released a test build with those assets in game. Think about it, if he is trying to build a fan base and get people excited about the game and the process of the game, he is going to try to make it as pleasant of an experience as possible while also working on the things he need to work on. He is simply trying to show what his vision will become when the game is finished.
@Chibit4 жыл бұрын
@@enderspectre4607 the problem isn't that he uses free assets. It's the fact that he lacks knowledge when it comes to 3d models. He uses assets that are heavily detailed. He's overloading the game with huge assets that are meant for 3d animation films or photos. These only need to render once! Compared to a game that has to constantly load large 3d objects everytime you leave and enter the area that contains them.
@water_doggo4 жыл бұрын
*TOOTHBRUSHE'D*
@tralphstreet4 жыл бұрын
That will change with Unreal 5, it can generate low poly versions out of high poly ones, it can cut down hours and hours of work because devs only have to do 1 detailed version and the engine does the rest, only displaying what's necesary for you to see, given the distance.
@adas20514 жыл бұрын
Nikephor YanDev is using Unity. I doubt he’s willing to swap engines.
@astropgn4 жыл бұрын
6:51 - When he Ctrl+F if, the scroll bar went entirely yellow
@RikaFurude69694 жыл бұрын
Lmao
@markusTegelane4 жыл бұрын
If statements.... THEY'RE EVERYWHERE
@sent44444 жыл бұрын
@@markusTegelane That is normal in any programming. Because coding is heavily logic. But for yandev, it is just too much.
@markusTegelane4 жыл бұрын
@@sent4444 ikr
@rkxd13374 жыл бұрын
@@sent4444 switch case is a nice replacement of else if btw
@Meowzors4 жыл бұрын
YandereDev adding pointless features every update on top of immensely unmaintainable code is probably why the game will never come out.
@enderspectre46074 жыл бұрын
The game will come out, but Its a lot of work for one guy. The, "pointless features" is not something you can give him shit for. There are hundreds of thousands of games with easter eggs in them. Its simply a way for developers to keep the game fresh for them and maybe even vent a little. Coding is stressful and its pretty clear you don't understand that.
@Sky_h4 жыл бұрын
Enderspectre You can stop defending him now. The game isn’t being delayed because he’s just one guy. Many have offered to help him but he refused because of his ego when they told him his coding basically sucked. And Yandere Dev DOES add pointless things like Mission Mode. Not to mention the amount of time it has taken for him to add just Osana into the game, and she hasn’t even been implemented properly yet. People have released games in less times than this, FREE and better games (with a larger team obviously)
@scavorthespacecowboy20964 жыл бұрын
@@enderspectre4607 Let me point out that HE WANTS TO FIX THE BUGS THEN MAKE OSANA. WHICH SHOUOD BE THE COMPLETE OPPOSITE-- THE MORE YOU FIX THE MORE BROKEN IS FOUND CREATING AN INFINITE CYCLE
@hmonglord4 жыл бұрын
@@scavorthespacecowboy2096 Then why not say HIRE SOME HELP
@vodkawhisperer39234 жыл бұрын
Its also a spaghettifest
@smalltiny4 жыл бұрын
It's kinda cool how he compiled all the rightful criticisms against his game in one neat list so if you ever wonder why people bully yandev you can go and check it out and be on your way.
@FlyMyTurtle4 жыл бұрын
It absolutely blows my mind how this is still not taken offline.
@blobbyblobb4 жыл бұрын
Lmao my software design teacher would be so mad to see how he coded.... Insanely low cohesion and high coupling, singleton pattern for a whole game??? Also no modularisation is shown :/ such a joke
@saldor01084 жыл бұрын
^^^ This is the real problem with the game, and it's a shame that almost no one talks about it. This is why the game is so unmaintainable. FPS issues are one thing, but architecture issues are what's really killing the project.
@megatronusv22154 жыл бұрын
Observer pattern, strategy pattern, factory method pattern. Literally any of these would have probably saved his bacon
@vogel24994 жыл бұрын
But let's give him credit where it's due. He belongs to rare breed of people who are capable of converting raw ideas into concrete execution, outside of his expertise. Gaming world would be a better place if only theres more game devs/designers that have the same level of initiative and patience like him.
@artyzn4 жыл бұрын
@@vogel2499 he isn't initiative, he is stubborn. A lot of good devs say that he's a bad coder. A lot of good 3d designers say he's a bad designer. He knows all that. But he doesn't hire any good devs or designers. Instead, he makes a debunk page where he denies all statements about him being bad at every part of his project. And I don't know how this can be considered initiative.
@vogel24994 жыл бұрын
@@artyzn Despite how bad his execution is, he is still better compared to those "programmers" who spent years in comp-sci department yet never produced something that even himself would use.
@cmdrgarbage18954 жыл бұрын
Dude i just found you but several days ago and i came to the exact same conclusion, people are kind of bashing him for the wrong reason. They're right to bash him, his code is shit but everybody just says "if else hihi". The thing i miss the most about his code is single responsibility. Does that file really need to be 8K+ lines long?
@codecrimes4 жыл бұрын
Yeah, I think it's alright to laugh about it but it's also important to understand on a slightly deeper level what's going so terribly wrong with yansim. I also feel like it's sorta warranted given his reply to criticism- like I said in the video, it's pretty embarrassing for the profession to have someone like this trying to manipulate people who don't understand it as well.
@ps4star2864 жыл бұрын
I noticed this a few years ago when I was watching some of Yandere DataDigger's videos. There was a video making fun of his code, but it was literally just him scrolling through some script files with the "look at this dude" meme playing in the background, and didn't explain at all what was actually wrong with it (and to be honest the code shown in the video didn't even look that bad. I know he's not a good programmer, but in that particular video I didn't see any long else-if chains or anything glaringly stupid like that, it all just looked normal). When I commented asking what exactly was wrong with the code, DataDigger responded "it's javascript lol." It's really annoying when people get into a mob mentality and start criticizing someone for frivolous or false reasons. It ends up making people who actually do have brain cells side with YDev more.
@codecrimes4 жыл бұрын
ps4star 2 My same experience exactly. That’s why I wanted to make this video. People don’t understand what’s actually going wrong (approximately) and it ends up hurting the argument against yandev.
@Zartymil4 жыл бұрын
@@ps4star286 in that exact same video there's literally a screenshot of code saying If (this.Type == WeaponType.Knife) { return "knife"; } Literally followed by ifs for every weapon type in the game. You might be wondering if there is a better way to program that (for the person writing/reading the code AND running code) and the answer is: yes there are multiple ways of writing better code. It's actually hard to think of a worse way to do this that isn't simply trying to be bad. It could literally be replaced by a one liner if you change other parts of the code: return this.weapon_name And just changing the weapon name in a prefab or whatever unity calls them And I get that some people won't understand the code shown. But bro that code is ugly af and it is amusing to me that someone can code like that for so long
@ps4star2864 жыл бұрын
@@Zartymil That must be a different video then. The one I'm referring to did not contain any screenshots, it was just a video of someone scrolling through his code. I went through her channel a few days ago and couldn't actually find the video I was talking about, along with several other videos I remember being on the channel, so I assumed it was deleted. Please link the video if you think you've found it and I can confirm if it's the same video or not.
@tsumikiminiwa46034 жыл бұрын
8:50 Not using "else" there is fine because of "return", because if it hits a return it leaves the entire method. Basically, using "else" and not using "else" there achieve the same result because the code inside the block is a return statement. Not defending yanderedev, but it's possible that he did that because the code editor told him it's the same.
@Spirit5324 жыл бұрын
Sure, it leaves the entire method. If it happens to fire the earlier returns. But there being an edge case where it CAN hit the last statement, thus testing every single condition before it, is a sign of incompetence.
@Ganerrr4 жыл бұрын
Which is why an array or some function should be used here. just if(x is in some bounds) {somefunction(x)} would bringe that code from O(n) to O(1)
@Spirit5324 жыл бұрын
@@Ganerrr no, that'd still be O(n). A switch would bring it to O(1)
@somdudewillson4 жыл бұрын
@@Spirit532 Something important to note here is that many compilers will actually turn switch statements into if chains for performance reasons.
@Spirit5324 жыл бұрын
@@somdudewillson If they're from 1987, sure.
@Sus-nn8sv4 жыл бұрын
Hey, at least he finished the website.
@URLeft4Dead134 жыл бұрын
I have no idea how to code but this was very informative so thank you.
@codecrimes4 жыл бұрын
Of course!
@katcherrypop4 жыл бұрын
Honestly, same.
@holyvicar4 жыл бұрын
Same, going to the comment section made no sense
@fatcat22able4 жыл бұрын
You have no idea how to code? Neither does YanDev, lmao
@redcum38334 жыл бұрын
@@cdfactory Lol "Anyone"? That will sound so wrong if you include YandereDev. He can't even understand anything.
@untrust20334 жыл бұрын
The debunk page essentially says: I am insecure about all of these accusations so must compile a list of them. He could have just ignored them and looked way better, but this is just funny how stupid this is now.
@hendrock10904 жыл бұрын
i thinks most of this drama (which can be seen on the debunk page) can be avoided if he listen to the criticism and stop acting like a child
@noriii4 жыл бұрын
Hendrock did you lie? not one bit.
@hendrock10904 жыл бұрын
@@noriii nope, it's 100% the truth
@noriii4 жыл бұрын
Hendrock yep that’s what i said
@Josuh4 жыл бұрын
part of me still hopes that he's acting like an idiot on purpose to gain more exposure or something like that, being as dumb as him is surreal
@vvvios4 жыл бұрын
This was an informative, well-versed analysis my friend. It's such a glaring coding failure with near-infinite "else if" lines that even someone completely unfamiliar with programming would understand. And you're precisely correct that genuinely every single "debunked" answer he gives is at best suspect, and at worst deliberately misleading. His answer to "Yanderedev is rude to his fans!" question is a beautiful example of this. He states that he has 600 fan interactions per month (serious, the exact number he gives) and so his rude examples are outliers. It's simply not an excuse - a developer being deliberately malicious, for example outright refusing to credit an artist even after being asked multiple times, is morally wrong. Even if it happens once in one thousand, it's still morally wrong. He'd have been better off simply admitting that much of his code is amateur and optimized, and simply admitted that he responded to fans maliciously due to being overly emotional. But on second thought, he wouldn't be such an entertaining lolcow if he actually took responsibility lol
@codecrimes4 жыл бұрын
Thanks very much, man! Yeah, my honest gripe with his code is not how it's done (though that's funny and pretty glaring), it's that he defends it, insults people who criticize it, and claims it's 'good code' and that people just don't know what they're talking about. If you don't like code, you won't get better at it- which is totally fine! He's allowed to just want to make a game, not a well-coded one. But then he blames the issues on everything else, fires his coders, doxxes people, all this heinous shit just to make himself seem... superior?? I guess? It's really weird, and I totally agree. If he just owned it and said what needed to be said, he'd not even be in trouble at all for what he's done, probably. Like you said though, it wouldn't be as hilarious if that was the case :)
@GaylordRobinson4 жыл бұрын
Please don't take kiwifarms seriously. They use autism as an insult. I don't like Alex either but that website is horrible.
@enderspectre46074 жыл бұрын
Nothing is, "beautiful" about that. Its true. He have been given so much shit for shitty reasons. I really hope you read that whole section, because looking at that one line looks really bad on his part. If you made it to the end, you should know that he says that if he said something to someone who didn't deserve it, that he would apologize to them.
@kenonerboy4 жыл бұрын
@@codecrimes cool video, but i really dont get the part when you say that he's "insulting unity". Really seem like a bit of a stretch. I think he simply doesn't know how to make it work in any other way.
@flarmie4 жыл бұрын
so to put your logic into perspective: how many times have you misbehaved towards someone then regretted it later? At least one time? Nope Bam Oops Sorry, unforgivable irredeemable human being the guy doesn't think that his shitty actions were okay, like people who aren't evil tend to do, it wasn't about being overly emotional he just got mad like a person who has emotions would get. no that doesn't excuse bad behavior, but you aren't irredeemable for having outbursts occsionally
@ajimit86694 жыл бұрын
that website background and font color is definitely a true crime
@myam7544 жыл бұрын
I feel like it was made in purpose so people won't waste as much time reading his "debunks"
@Sevenisko4 жыл бұрын
It's a raw output and the browser doesn't have a highlighter for raw code files.
@mmspaget4 жыл бұрын
"Graphic design is my passion"
@erikshure3604 жыл бұрын
Jesus Christ. Replacing "if else" statements with a bunch of switch statements doesn't really solve anything. In fact, depending on the compiler, they end up being converted to the same thing. The real problem here deals with the design patterns being used -- they are poorly implemented.
@TourFaint4 жыл бұрын
This is not exactly true, a compiler will try to merge a ton of elseifs into a switch, yes. But if the code is messy, or the var's checked arent named consistently, the compiler won't do that perfectly. The compiler will try and merge for example, 50 else-ifs into 10 switches, or even 5, but that's still 5 times more than it should be. Don't pretend like a compiler is some godly machine that knows your code better than you and will magically make it super fast even if you type like a monkey. If compilers were magic like that no one would ever bother to code properly.
@quack38914 жыл бұрын
@Flojomojo I was wondering, could a normal person feasibly just install the jump table first before the compiler does it with switch statements?
@Poneglyph4 жыл бұрын
Erik is right. Substituting a switch statement does nothing to improve the real problem which is poor achitecture and design patterns.
@theironsword19544 жыл бұрын
@MeatyGraffiti Does ANYONE know what OOP is? Functional and imperative are typically far cleaner in my opinion.
@theironsword19544 жыл бұрын
@MeatyGraffiti Perhaps. But I was meaning in general. Either way, I was (somewhat) jesting, each has its uses and disadvantages, even if I cannot wrap my properly head around the mess that is OOP.
@kanaizo4 жыл бұрын
As a person learning C# and is currently on Day 2, I would like to give thanks to YandereDev for showing me what NOT to do. It's really been helpful, not even joking, I'm seriously learning about how to avoid bad code.
@1x5x73 ай бұрын
4 years later, do you code better than Yandere Dev?
@kanaizo3 ай бұрын
@@1x5x7 not gonna lie, I quit programming for a while, so definitely not lol
@bitwize4 жыл бұрын
A lot of people say "he should have used a switch here" but there are higher level constructs, such as delegates and FSMs, that a game dev could (should!) be using to create variable behavior. Why not give each student their own update method instead of saying if(Student.Id == 97) then {...} else if(Student.Id == 98) then {...}? Why not put student personality types into a LUT taking personality type to behavior and have the student update method dispatch on that? It's kiddie BASIC coder madness in there.
@konata45674 жыл бұрын
The reason they suggests using a switch is that Yandev can't be arsed to do higher-level shit, so we might as well give him something simple to understand
@Gismo3594 жыл бұрын
This code is from a decompiled debug build, and in debug most switch statements generate the same assembly as an else-if chain. People who review this tend to focus on mainly that point when they don't even know how to judge decompiled code.
@bitwize4 жыл бұрын
@@Gismo359 There are instances where Yandork used a switch statement just to learn and experiment with it, and it decompiled as a switch statement. He even talked about it in one of his vids. So my money is on, if you see if-else if being used, chances are Yandork wrote it like that. Anyway, it doesn't matter because a switch is little more than syntactic sugar over if-else if anyway. He would get much farther using FSMs, LUTs, delegates, and making student behavior more data-driven. But by the same token, if he can't use switch statements, all the higher level crap is going to be black magic to him. His code really is that bad. I'm reminded of John Romero's story of when he was a kid, and he was writing a video game in BASIC and got stuck, he couldn't make his video game any faster or more complex. Then he discovered BASIC has these things called variables that can hold values...
@Gismo3594 жыл бұрын
@@bitwize That may be true, but it is an objective fact that most switch statements in _debug_ get translated to the respective else-if statement in IR. The decompiler can't know whether the original was an else-if or switch in those cases. These types of videos never complain about real problems that he may have int his codebase - which he definitely has. They complain about stupid stuff that they have no understanding of. The point about the switch statements has been brought up by every single one of these 'critique' videos as the main flaw in the code - most of them don't talk about anything else. Even if they were actual else-if in his code - the compiler in release is more than competent to convert the vast majority of them into jump tables - the overhead of the few that don't would be insignificant. You would need a few hundred, maybe thousands, to notice an actual difference. I'd argue that, even without FSM and manual LUT, there should be no noticeable slow down - FSMs are usually applicable in a relatively narrow range of problems, while a LUT may not make a significant difference unless the number of elements is over a certain threshold - sometimes hundreds, depending on the data type, order and whether all indices are equally common or not. The switch's jump tables are defacto the same as a lookup table when you're just returning a value. My guess is that he is calling Unity's update functions when he shouldn't, which would cause multiple updates on the same object - and it would probably get even worse as you go down the object tree, if it is a reoccuring problem in multiple dependant classes. That, combined with a flawed design/logic in a bigger scale, is much more likely to be causing the performance issues people are reffering to.
@bitwize4 жыл бұрын
@@SubNano144 Please. Yandork isn't that smart. He's got string comparisons running every frame to determine the student personality, for crying out loud -- meaning not only does that add to the slowness of the StudentScript, it means he never thought to use enums for that purpose. Encoding every possible student behavior into one long, deeply nested chain of if-elses (or even switches) in your StudentScript is going to blow your I$ anyway, not to mention become a PITA to maintain. The whole idea behind the use of delegates is to assign to each student only the behaviors that they need to run on each frame. If you want to optimize it, employ the Command pattern and replace the delegates with enums that are then dispatched over. But we are getting *deep* into the optimization weeds -- far deeper than Yandork has the mental capacity to maintain -- and the .NET CLR (and, presumably, Mono) does a good job of optimizing delegate calls anyway, especially if they are lambdas that don't access free variables.
@user-mg4zu7bs6i4 жыл бұрын
TLDR: Yandere Dev has been doing this for 6 years. Nothing has been accomplished, but FPS issues and lack of progress are based on different issues. With FPS, it may be because he ripped off a lot of graphics that are not optimized for the game, but the coding style probably makes it very hard and mentally exhausting to maintain and make large updates to the game, which is why he is so slow. I don't agree with why the code is bad, and I have watched multiple videos and none of them really talk about the issue of maintainability, which I believe most developers would say is the biggest problem here. Refactoring if/else statements to switch alone will not cause a noticeable FPS improvement - that must have more to do with the graphics (I know nothing about that) than code logic. Example: Running those if statements at 9:20 will never tank FPS - it's comparable to running an empty for loop (for (int i = 0; i < 80; ++i) {} ). And the compiler might just optimize that portion of code into a switch statement anyways. The real crime is that a function is 8000 lines, and very poorly modularized (in my experience, with larger software, when a function is even somewhat "complex", which it usually becomes if it is, say, over 200 lines, it is considered unacceptable and should be refactored). If anything needs to be changed, it is a nightmare to go through and manually find and change all related items. There are no enumerations, or helper utility functions to do the job in the update function. Some examples to that might improve the code, again at 9:20: (1) package the logic in a separate class/function dealing with SubTitleType. You might have an enum "SubTitleType" with enum parameters ("StudentID", "TaskLine"), and a function to return a task line. Now all of that code is in a much smaller module, and you don't need to sift through 8000 lines to make a change to something. The if/else statements are condensed into one line of code, which is the enum function returning based on the student ID. (2) Include some sort of property that tells if a subtitle should be displayed. The boolean property is initialized once only, and forgoes the need to check this logic every time update function is called. The TaskLine is formatted based on the StudentID number anyways, if the property is true. Then it just because one "if" statement in update().
@codecrimes4 жыл бұрын
Absolutely agree. My intention was to communicate the poor practices here, though, specifically to people who aren't very familiar with coding- and modularity and maintainability is generally something that's hard to grasp for even relatively experienced developers/coders. Something I neglected to mention in the video above is that this script is running once per student, which is legitimately why the FPS drops like it does around students. The update function is being run once a frame per student, moreover, which, even if chains of ifs as shown probably aren't causing it alone, would definitely still exacerbate small issues. I personally believe your logic here is correct, regardless. The code being a mess and having no real room for expansion (and treating everything as if it needs to be handled in a constant update loop rather than on a case-by-case basis using triggers) is certainly why the game's development has ground to a halt. It's also why a lot of this code still exists, if I had to guess, because I sincerely doubt yandev still doesn't see what's wrong with the format of a lot of his product- it's, as you said, likely a huge nightmare and a week-long project to uproot even simple issues and fix them. Again, my goal was mainly to allow those outside the field to appreciate the level of neglect going on here. If you're more invested in why a piece of code like this is truly disastrous, though, Alex up here is 100% right.
@oniviper4 жыл бұрын
I couldn't agree more. I wouldn't necessarily say his code is bad (and I've seen bad) so much as it's riddled with a ton of very poor programming practices. It may not even be unusual, depending on the application of course, for a script to have 8k lines of code. But his UpdateRoutine is trying to account for all the logic and behaviors of each character, which results in way too many unneeded nested if else statements. I would assume that also means a lot of repeated code that could've been shoved into a separate function. It's completely unmanageable. Even adding a new character or weapon would be a daunting and exhaustive process.
@oneoneoneoneoneoneoneone4 жыл бұрын
can i get a tldr on this
@sacstanxiang37364 жыл бұрын
@LeviathanSVK probably something like instead of finding taco bells everywhere world wide, just go to your local taco bell
@user-mg4zu7bs6i4 жыл бұрын
@@sacstanxiang3736 TLDR = first paragraph. It's similar to "instead of managing all documents in one pile, sort them into related categories, and when you need to update/use something, just go that category."
@bored584 жыл бұрын
There's something inherently wrong about doing things this way, not just related to code. Personally whenever I'm tasked with doing something tedious and repetitive, at some point I start to question the validity of my approach and start thinking about ways in which I could be doing the task faster and more efficiently. I can't fathom sitting there hours on end writing code like that and not at some point realizing this is a huge waste of my time and that I should look into alternative ways of writing it. It's like lumberjacks using handsaws and when being offered chainsaws they'd go "no, our way of doing this is perfectly fine and fuck you for suggesting otherwise"
@DravicPL4 жыл бұрын
Let's pretend that mental illness is not a thing. The only mistake Yandere Dev has commited is showing you idixts what he's doing in the kitchen.
@k_tess4 жыл бұрын
@@DravicPL No the first mistake he made is never opening a textbook on programming. Or watching any videos about programming philosophy. Seriously C# has tools to do half the shit he's expending these nested if/else if statements. Like seriously arrays and loops could solve roughly 25% of his problems. Another 50% could be solved by understanding Object oriented programming philosophy. And finally Unity itself has tools that could help him. Like pathfinding.
@maxmaus44024 жыл бұрын
I have no idea who you are, Forte sent this to me 15 minutes ago, and I'm amazed. Very good video, also I've never seen Ctrl+F lag this much outside of Visual Studio
@codecrimes4 жыл бұрын
Thanks yo! Yeah, it's actually really good in this video- if you're far enough away from what you're searching for, it takes genuinely five seconds. This is only one script, ftr!
@susrtable28414 жыл бұрын
thanks, this helped me understand why people were bashing him for his code, i did learn coding for like 2 months in school but i didnt exactly understand, but now i get it. thank you
@banana_4 жыл бұрын
nobody would be angry at him if he listened to critics and learned something
@kenonerboy4 жыл бұрын
His code looks like something a secretary or gradeschool teacher would write. String comparisons everywhere and 0 loops.
@TheTigero4 жыл бұрын
His code looks like something a COMPILER would write, because all we are seeing is decompiled code. It's honestly not bad
@kenonerboy4 жыл бұрын
@@TheTigero good point. We tend to forget that.
@Rafale254 жыл бұрын
Kevin Klika Exception that compiler tends to create optimized code
@TheTigero4 жыл бұрын
@@Rafale25 optimized for a computer, not a developer...
@kenonerboy4 жыл бұрын
@@Rafale25 uhh optimized in what way?
@ramnophone6650 Жыл бұрын
one thing funnier than the code itself is the colossal in-depth thesis of a debunk page
@satrioarif17974 жыл бұрын
I remember getting excited for this game first time i got to university, now i am graduated have a job, got fired, and get another job and the game still NOWHERE NEAR to complete lmao
@PickleSurpriseVEVO4 жыл бұрын
His debunk page is essentially a giant if else statement of scandals
@xNaxdy4 жыл бұрын
8:10 your error aside, this is the most horrific piece of code I've ever seen. It's clear that for every student ID that is checked, there's a corresponding task line, so why in the world not just make an array or a map using the student IDs as keys and use something like this: if (SubtitleTypeMap.ContainsKey(this.StudentID)) { return SubtitleTypeMap[this.StudentID].TaskLine; } what if he adds another student ID? Gotta change all of those if-elses again, and I doubt this is the only place where something like this exists
@kurtischarlton29104 жыл бұрын
I feel like a big solution to these problems would be to go the object oriented route and actually make a student object and have event handlers for these student objects. Correct me if I’m wrong, but yanderedev doesn’t use his own objects at all in a language that does tasks in an object oriented way very well. Just a suggestion
@badpockets4 жыл бұрын
Wish there was a way to like this comment more than once. OOP would’ve made this code base sooooooo much simpler to maintain. It also would’ve run smoother by loading in only the objects needed to evaluate at runtime
@Reivivus4 жыл бұрын
You are 100% right
@kota22232 жыл бұрын
You're right. But also, it is absolutely possible to program something cleanly without object orientation. It's just that he has zero code organization skills.
@kurtischarlton29102 жыл бұрын
@@kota2223 very true, agreed
@adamflyshotmail4 жыл бұрын
When I was getting my degree, I came up with a sort of set of philisopical laws for coding. The first one being that the coder is ultimately responsible for their code. You can't blame anyone but yourself if it runs poorly, even if the code base you use makes things difficult. It's literally your job to make it run well. Guess who hasn't come to the same conclusion...
@Exynos4 жыл бұрын
I really dont think the main issue are all the if and elifs chains. Yes it's a shitty practice but it's not the biggest issue. I haven't decomplied this yet but what i keep seeing is the bare minimum level of abstraction. There are so many lines of code that are just repeated constantly for every single action. Every single student has thousands and thousands lines of code which are each just repeated. And there are so many... questionable... things being checked every frame with more elif chains. You just cant maintain this and as a game dev you need to be ready to scrap all the code and start again. But this guy is taking a 1 ticket train to hell and following it through without any considerations of the future. I wouldn't even call him a programmer because a child doing a project on Scratch is essentially at the same level as him. This game had potential and was earning hundreds of thousands of dollars with companies eyeing it, but all of it is gone to waste because of an incompetent "developer". Any other dev would've went through with the original vision and make a happy living off of it.
@CoolModderJaydonX3 жыл бұрын
Why did you say "elif" as in Python?
@Poneglyph4 жыл бұрын
Game wouldn't run with 8000 lines on every update? I'm _pretty_ sure games run significantly more than that once you unroll the functions. YanDev problem is his poor architecture and design patterns. And switch statements are not the answer by the way.
@АнтонГусев-н5ю4 жыл бұрын
You can't run 64*32 two-operation segments per frame without dropping to, like, 10-5 fps. You can't do this in Rust, the second/third fastest language. What matters is the efficiency of the code that runs each frame.
@halinaqi21942 ай бұрын
Its about the lines you make that run each frame, shit like 1+1 is east for a computer, but calculating an angle? Or generating a random number? Collision check? Yandere dev here is doing a lot of these expensive function calls in the update function, every frame. I'm dying looking at this code, and my code isn't great admittedly lol
@AevenIridescent4 жыл бұрын
The code is ugly? Yes It's ineficient? yes It's messy, confusing, the textbook example of bad practice? absolutely It's the script itself so big that every instance of it for every student takes a considerable amount of memory? disgustingly so. However, i believe the framerate issue is not caused entirely by this. And i say i believe cuz i cant confirm it since i dont have access to the code. In the Update method, after inefficiently checking who the student is and what it should be doing for the specific time of the day, for the specific day of the week, for the specific club, if the club is still active or not, and who knows what sort of other unholy things. It makes a call at the Pathfinding. I repeat. In the UPDATE method. So every frame each student, after contemplating life and all existance and figuring their place in life, makes the expensive calcullation of how to get to their destination, Takes one step, and does it all over again the next frame.
@edwin51454 жыл бұрын
dude awesome video! Entertaining and valuable information. Good work!
@btarg14 жыл бұрын
This page is incredibly sad, it just makes him look even worse.
@bastion88044 жыл бұрын
Right? It's just him putting every criticisms thrown at him into a spotlight. It's one thing, although still not optimal, to have all of them be wrong. The fact that he mixes truths and lies there makes it hard not to think that all of them are true.
@bastion88044 жыл бұрын
@@evewhoo Yeah, that's like someone receiving news that someone will sue him and then spending the next day letting everyone in the neighbourhood know there's a reason why he's being accused of such and it's false, going to more detail than necessary, and he's also not x,y,z complete with megaphones and all. Like, why?????
@archiveacc32484 жыл бұрын
Can you imagine being yanderedev's professor or TA in college trying to teach him? You'd have to give up, he wouldn't learn a whit
@Chrischi3TutorialLPs4 жыл бұрын
The most ironic thing about YandereDev is that he has an entire debunk page explaining, in great detail, how and why he can, infact, take criticism.
@isaac82284 жыл бұрын
>>Sees example of bad code: Me: *Sudden concerns on personal project*
@cemalettincembelentepe89434 жыл бұрын
As a developer myself I would like to add my opinions here. First of all, yes the if statement usage is completely wrong at some cases but it won't affect the performance when you switch to switch-case since even at this stage compiler will understand that it is a switch statement and use switch since if/switch concepts are just related to a higher language but not to machine code. The compilers also have branch optimizations which will check the branches and if they are same just link them together. So my problem with that code is it is not structured. He uses C# which is a primarily OOP language, which means that you need to separate related data and functions work on that data to a class. For example, rather than the main system checking each individual, each individual should check their own states in themselves when the main system orders them. But the code written in a way a bad C program is written, it is procedural so that yes there are some data and not every function working on them is a part of the class, but it is a very bad procedural since not every possible separation on functions are done(correctly). I believe the developer has never made a game before since I see the same mistakes I did when I developed my first game on Unity. My game was smaller but nevertheless, they have the same problems. Also for reference to say that I know what I am saying, I am a CS student and wrote a simple compiler and a simple game engine before :) but I am no expert at those topics.
@regal69304 жыл бұрын
8:38 uhh, that block is ugly and should be refactored but it doesn't run every if-statement (except in the worst case) because if it finds the number it returns a value back to the caller and the function ends...
@АнтонГусев-н5ю4 жыл бұрын
I think that it does not matter when talking about algorithmic complexity, as we're assuming the worst case.
@SpecialKapson4 жыл бұрын
Here's how I see it. Been in unity for quite some time too. Performance is the least important thing here. Well yeah the game barely runs but that's not the end of the world tbh. The real problem is the lack of architecture. Programmers hate unity for how easy it is to slap stuff together and call it a game. This is exactly the case with yandere. This code is borderline (not even remotely exaggerating) impossible to maintain. Why do you think osana or whatever the hell the next update is, is not coming out.
@koolgoose4 жыл бұрын
I’m also a unity user. The way I see it, most programmers hate and love unity due to how easy it is to slap things together. Your workflow is way faster, but this also allows assetflips and “google play store games”, you know... it’s a double edged sword that brings many many terrible games into the world, but also many other amazing ones that perhaps wouldn’t have been here at all if it wasn’t for unity. I’m interested to see what godot has in store though!
@SpecialKapson4 жыл бұрын
@@koolgoose unity is very cool for smaller games and prototyping Bigger games can be made but serious caution must be taken and blunder architectural choices must be avoided (experience needed)
@koolgoose4 жыл бұрын
@@SpecialKapson Absolutely. Just look at Rust or Escape from tarkov, both massive games that could use some more refactoring. (Care must be taken since the start as you said)
@_iphoenix_61644 жыл бұрын
I'm not familiar with any of the backstory here, BUT The real code crime here is measuring performance stuff in lines- measure performance stuff in milliseconds, FPS, etc. Like you said, like numbers are deceiving and are subject to things like formatting, conditionals, etc. Additionally, modern compilers typically recognize and eliminate a lot of the problems you talk about (ex. else if vs if), but that's not an excuse for bad code. His codebase does seem genuinely pretty terrible, though, and his attitude as portrayed here seems even worse.
@jaywye4 жыл бұрын
It's easier to read for him, that's why he does it.
@JefOliveira904 жыл бұрын
"I'm not a bad coder, I have a single method with 8k lines" Bruh...
@47Mortuus4 жыл бұрын
Why are you constantly saying that if the game ran 8000 lines OR EVEN 800 LINES of code in an update function, it wouldn't run at all? I can run 1.000.000 lines of code in less than one frame per core, with zero cost, because I have to wait for the GPU anyway... It's not 1974 anymore.
@cmdrgarbage18954 жыл бұрын
Oh my fucking god, you can't be serious right? Do you even know how coding works? A line of code could be: } Or: Objects.Addrange(local_objects.ToList()); A line does not mean anything for god sake. You don't know how many lines of code your processor can do each frame because there is no fucking answer to that statement.
@supermonkeywtf094 жыл бұрын
Dude this would be an awesome series, entertaining code reviewing is a concept I haven’t seen elsewhere and you have executed it really well. I hope you consider doing a few more to test the water, is fellow devs would dig this.
@supermonkeywtf094 жыл бұрын
Also subbed , holdin out for a few more Code Crimes!
@frostoise4 жыл бұрын
This is the only video that understands the fundemental problem with his code, and isn't another one made by a beginner programmer yelling "uSe a sWitcH sTateMent.". Although i don't think it is acceptable to have 8000 lines in update method anyway. If they aren't running every single frame, why are they on the update method? Also with a well thought out Inheritance scheme, i feel like he can cut out his 8000 lines to around 100, seeing he has severe code repeats and same variable conditionals.
@halinaqi21942 ай бұрын
I actually feel like there's a similar problem, I was just doing gma 2 on the fly, and I was programming a game like stick war. Each unit has 3 main states, + death. But the death character is a separate object that spawns in as the character is destroyed. I had to make each unit know the closest enemy to them, control their movement animations collision etc. And even then, I cant optimize it that well because some expensive function calls you are just going have to eat up, collisions with frame precises animations is one of them, the other is the instance nearest call. But even that, I understood, limit the usage. The instance nearest call is done once at the beginning of the step event and stored, then just checked later with conditionals. But looking at it now, I can make the performance even better by just checking instance nearest once per second (likely wouldn't even be noticeable to the player, or half a second) and but a lot of the other stuff I wouldn't know how to, except limit the amount of units. Another expensive thing is to reference global variables, so its better to call them on startup, save it to a local variable then use that local variable going forward. The ai strategist script was also long but as the ai that literally commands the enemy arm, its necessitated to be somewhat complicated as it has to react to the players massive amount of army permutations. At least though, there's only usually 1 of those in a scene / room.
@Rose-vp5gn4 жыл бұрын
The whole debunk page is just: *insert claim here* Yandere Dev: In short, No I didn’t. One of the claims is that he wants to kill his parents, which is based off a post he made talking about wanting to kill his parents a few years back, and he responds with he was a teenager and didn’t know that he wrote that because somehow he doesn’t remember feeling that way and was “surprised” to find out he did that. Another claim was that he wrote a story about r*pe but he defends it saying it was about a slave being abused and the slave owner dies badly therefore it’s okay! And the assault scenes weren’t meant to be sexualized, they were just there to show the slave’s struggles. This is questionable considering that this is Yandere Dev and of you actually look into him you’d know that he doesn’t see women in the best light. Also, if he weren’t meaning for it to be sexual then he shouldn’t have written it in detail??? The same thing can be achieved by simply stating that she was assaulted without all the details.
@Nesquik9084 жыл бұрын
Trust me,most Hent*i is about r*pe,and it's less disgusting than this.I don't know who he is writing it for,since it's too detailed on the r*pe part,almost no stories including r*pe is THAT detailed.Even h*ntai have guys much less rough than that.Seriously,if he wanted to debunk the theory just delete the fucking post already.
@Alienrun4 жыл бұрын
Why even have such a detailed "debunk" page anyways? It makes one look SUPER emotional to critisism lol (that's my view anyways idk if that's true or not)
@slakkenhuisdeur4 жыл бұрын
That's because he is... In other videos covering YD I've heard "[YD] treats mild criticism the same as a [not alive] threat" and I've not seen much that disproves that. How well YD takes criticism has also been memed pretty hard with: speedruns of getting banned on his Discord (record is
@purplejinxer34784 жыл бұрын
@Nothing Noone I'd bet 5 bucks that his fan base is made of 16 and under. You can see it with the arguments they use to defend him.
@bastion88044 жыл бұрын
@Nothing Noone Hey, don't talk as if he's not one. He's the one taking initiatives in implementing these "features."
@АнтонГусев-н5ю4 жыл бұрын
@Nothing Noone this dude was like this before he even thought of the game, lol. Also, he *tried* to have an audience of sweaty neckbeard weebs (like him) but instead found himself with majority of teen girls who think that edgy is cool.
@lesscringeymapperdude4 жыл бұрын
@@АнтонГусев-н5ю this is what happens when you do not give characters big breasts. If he did He would have creepy old neckbeards
@RapiBurrito4 жыл бұрын
For the weirdos out there looking for else if pron: The Linux kernel Thank me later
@markusTegelane4 жыл бұрын
Nice.
@mykhailooryshych52274 жыл бұрын
well at least the Linux kernel doesn't take a second to switch tasks
@Shaddonius4 жыл бұрын
From my point of view, the main problem with his code is that it's really hard to follow and understand. I've stared at it dumbfounded for like 30 minutes and I still couldn't make out what's supposed to be going on other than some data being populated somewhere. The first thing I would do is create classes for each of his students or entities or w/e with the data he seems to be populating them with in the if/else cascades and that would shave a significant amount of lines of code along with improved readability and more efficiency since you don't have to branch so much and work with static data instead. Still, in spite of criticism and how easy it is to debunk all those claims, at the end of the day, he still shipped a working product mostly by himself which is more than I can say about myself. I've seen some shit in my life and no matter how bad it is, with a bit of willingness and experience it can be fixed. Getting sales, returning customers and a market share is the actual really hard part.
@T33K3SS3LCH3N4 жыл бұрын
When someone wants to counter the accusation that they can't take criticism, publishing a multi-page manifesto on their game's website may not be the best approach.
@danieleccleston79284 жыл бұрын
10:52 Right!? task failed successfully
@darkmattergamesofficial4 жыл бұрын
He showed the Profiler in action and proved the code was not the performance bottleneck. I am a Unity3D/C# developer. His code is certainly unreadable in parts and over engineered, but its not the performance stopper. Most of the code is using an if/else control flow pattern which is bad but in the grand scheme of things is nothing in comparison to the physics/animation/pathfinding subsystems that run independent of his character updates.
@Galomortalbr4 жыл бұрын
me: my code have 49 ifs and 9 elifs, write 217 lines on single file and breaks OOP, fuck my code is horrible yandere dev: my code has 2300 ifs and 597 else ifs, and dump 8k lines of code, i'm a good coder lulz HOLY SHIT
@Meaxis4 жыл бұрын
You made me realize there is a switch in PHP. Thank you. You have improved my coding skills.
@PhysiOSQuantum4 жыл бұрын
I get that his update function is a mess but Everytime some guy or girl says "this can be run with a switch case" its irritating, switch cases might be faster in some occasions but changing if statements chains with switch cases isn't that much of an upgrade.
@xXxEzzaHxXx4 жыл бұрын
Yanderecuck:"I'm not a bad programmer!" Also Yanderecuck: if(!false)
@XektorOfficial4 жыл бұрын
I have no idea what he was thinking when he wrote that. Plus there was another return after the if statement which of course will never run because of the former.
@xXxEzzaHxXx4 жыл бұрын
@@XektorOfficial He probably wasn't thinking at all. Yanderecucks inner machinations of his mind are an enigma. kzbin.info/www/bejne/gX-9hIukp8emlc0
@SubNano1444 жыл бұрын
That doesn't actually exist in the original source code. That is a decompiler artifact introduced by reconstructing a C# representation of the CIL byte code.
@xXxEzzaHxXx4 жыл бұрын
@@SubNano144 I mean yeah, but he still has a stupid condition in there thats always true. The whole code is garbage to begin with. Why not just SubtitleType.getLine(ID)? Then you dont have to check a million conditions and have constant lookup, if you use hashmaps.
@SubNano1444 жыл бұрын
@@xXxEzzaHxXx It could be a constant for debugging purposes, which would be reasonable and not uncommon. I can't defend the rest of the code and overall structure, which leaves much to be desired. I'm just pointing out that most things everyone is focusing on are not the actual issues.
@ndescruzur43784 жыл бұрын
2:49 sometimes english make very funny sounds...
@timcronic23414 жыл бұрын
I'm biased because we are literally friends already but genuinely, good and informative video. Doesn't need a lot of coding information, too.
@twolw3r7624 жыл бұрын
In a stealth game you NEED fps you cannot play a stealth game with 11fps 30fps is minimum
@SomeNormalArtist4 жыл бұрын
Not even, this is a pc game so a lot of people expect at least 60 FPS.
@twolw3r7624 жыл бұрын
@@SomeNormalArtist i found out theres a game called warashi no mono (still in develepment). And you dont get 11fps
@xZyane4 жыл бұрын
@@twolw3r762 Watashi no mono will not be continued tho.
@twolw3r7624 жыл бұрын
@@xZyane oh wow rip
@elliot_rat13 сағат бұрын
the fact that he's putting these accusations on a pedestal at all proves his guilt
@fritt_wastaken4 жыл бұрын
Just 15 seconds looking at his code and my eyes are bleeding. I thought folks crunching all functionality into a single class were a myth
@ericlee75674 жыл бұрын
When you have the time to make the debunk page but not the time to optimise your game *hmmmm*
@enderspectre46074 жыл бұрын
I don't think you understand what the problem is. The problem is he is working on new features of the game before optimizing his code. I think that we really can't say much till the game is released. Its not our game, its his. How he goes through the process of making it is his deal. People can do multiple things.
@ericlee75674 жыл бұрын
@@enderspectre4607 no surprise you misunderstand my comment. "optimise the game", here I mean he should just work on the core / main features of the game instead of other features. Of course it includes making his code better, but i have no idea about coding so i'm not gonna comment on that.
@ericlee75674 жыл бұрын
@@enderspectre4607 the first time i played his game was 2 or 3 years ago, and now the game still doesn't have a proper ending?? Like wtf, he's like building a huge Lego building, but only wants to build higher and higher and not caring about the base
@ericlee75674 жыл бұрын
@@enderspectre4607 Basically i mean he should optimise the base of the game first
@purplejinxer34784 жыл бұрын
@@enderspectre4607 It would be his deal if he wasn't milking naive kids' money.
@_________________4043 жыл бұрын
Holy shit, this guy reminds me of the one person from school who even after 3 years of taking programming classes didn't know what a for-loop was.
@asheepwhereitsnotsupposedt3383 жыл бұрын
honestly, after taking a course of intro to programming, I wanted to see what yandere dev's code was like upon hearing it was really rudimentary. Here I am, starting the video.
@democorn66194 жыл бұрын
Can we all just realize that he put the fact that he prioritizes readability over efficiency, yet he has no comments.
@Homiloko24 жыл бұрын
What you mean? The code is not readable nor is it efficient
@democorn66194 жыл бұрын
@@Homiloko2 not sure if that was sarcastic or not, just in case this is what I was talking about. paragraph 4 line 2, "For these scripts, instead of focusing on efficiency, I merely focus on readability; how easy it is for me to understand the workings of the script at a glance."
@bastion88044 жыл бұрын
Yes, that's his motive, however he fails to realize that simple code doesn't mean it's readable.
@TheTigero4 жыл бұрын
This is decompiled code, bro. So not only is it not accurate to judge him based on it, stating that he has no comments is silly because the compiler will strip them out...
@cataclystp4 жыл бұрын
@@TheTigero this. dude made a comment without knowing the basics of how compilation works. know your shit before making fun of someone's code.
@shroomer38674 жыл бұрын
That Space Station 13 bookmark though. You know this guy is the one who goes engineering.
@gabrielecocchieri75883 жыл бұрын
wtf jeez please just let this guy free, let him do what he loves to do!
@MrMinebase4 жыл бұрын
Most of these ifs could probably be removed if he would use a state machine.
@TheTigero4 жыл бұрын
Um... That is a state machine.
@Cash121214 жыл бұрын
What I find appalling about the code. Is that running mass of else if's and returns in such as one method. It can create a huge amount of untested code paths. It's the reason why he constantly needs to spend more time that he needs to debug and fix bugs. If you want to minimize his potential bugs. He needs to learn to code efficiently/cleanly.
@YaroLord4 жыл бұрын
the most hilarious part of this, is that he tells his fans that the code analyzed in this video won't even be in the final game as in, he'll just rewrite and debug the entire thing before release 😂 AND HIS PATREONS BELIEVE IT!! it took him 6 years to give birth to this clusterfuck of elseifs and he expects people to believe he'll just rewrite it lmfao
@joeedh4 жыл бұрын
One of the most valuable things I learned during my forway into art school was how to give and receive criticism. I've always thought we should have similar training for software engineers. The way people are "criticizing" YandereDev is not how constructive criticism is supposed to work. You're specifically trained to *not* turn criticism into an authority/submission power struggle. So far every one of the KZbin videos I've seen have violated this rule.
@lightlysal4 жыл бұрын
Yeah, people get mad and overreact too much, but it's ignored because their target was the first one to be wrong. But damn, is it entertaining!
@gardener_leaftail4 жыл бұрын
I am not a unity programmer, but I am a python programmer; optimization matters most when making games, because because the game speed is tied to the frame rate I think.
@eliekira75214 жыл бұрын
I had to take a short coding program a year back. Using 'else if' was one of the first things we learned. Like we used it in the first lesson. And then we went on to more complicated code in the remaining lessons. I remember we rarely had to use 'else if'.
@matejpesl14 жыл бұрын
-.-
@xBire4 жыл бұрын
This was really informative, I aspire to be a game coder as a future occupation (but never took video game coding classes). I haven’t scanned through your channel yet but if you can make more videos like this I would love it. P.s. if you have any advice for someone like me needing a place to start learning about game code (what resource should I use to learn this, as in book recommendations, site recommendations, etc...) it would be really helpful
@RedzeeTV4 жыл бұрын
the StudentID-checking could be optimised greatly by using an array. he’s constantly checking for numbers to match using if-statements. with an array, the StudentID numbers correspond to array index numbers, which would allow him to grab whatever he needs instantly. am i wrong?
@justarandomwanderingsoul48303 жыл бұрын
a dictinoary or HashMap would be better
@RedzeeTV3 жыл бұрын
@@justarandomwanderingsoul4830 definitely a hashmap. did not know about those back then
@Inevitablerizzler4 жыл бұрын
One observation should be made that some of the points you make in the video are not true, might be because you are not familiar with the C# language or because in the moment you were just not paying enough attention. The code is bad, and this is a fact, no argue You were pointing out that in certain scenarios where there is a lack of "else if"s every "if" statement will be executed, which sometimes is just not true(but I am referring to the times where you were pointing this at the wrong times), there were a lot of "if"s that had as a result a return from the function, thus the "Update" routine would return to the original frame from which was called, what you said would've been true if we were only talking about the worst case scenario(only the last if statement actually needed to be called at runtime, thus all the "if"s would need to check the conditions), I am sure this was just a small mistake on your part, and on a closer look you would instantly realize the problem, I am just pointing it out for people that might be confused by what you said.
@codecrimes4 жыл бұрын
Thanks for pointing this out! This video is my genuine first reaction (minus a very brief read-through beforehand), so I was trying to be as concise as I could be without a script and so on and ended up passing this important detail. I've put up a comment referring to this mistake. Thanks again! :)
@hikari_no_yume4 жыл бұрын
Unless the source-code was leaked somehow, isn't it the case it's all decompiled? That means the use of “if”, ”else if”, “else” and “switch” is probably a reconstruction of the original control-flow which won't necessarily reflect how it was written.
@yankobig86124 жыл бұрын
Everybody is starting to learn coding after this video.
@fibbbb9094 жыл бұрын
had a mini panic attack imagining debugging 8000 lines of code
@Mark_nobody34 жыл бұрын
Code can be compatible to be shorter so it can check veritable faster, easy and does not clog the data script
@cuttingchai82314 жыл бұрын
He could use something like Resharper and StyleCop and it would happily help him improve his code. That and just using a static analysis tool. Now most of those are expensive but if he open sources the code, Coverity provides free scanning. At this point, he would be well served by just open sourcing the game and letting people finish it for him.
@LunaticEdit4 жыл бұрын
I've been down the KZbin hole on these videos. Been coding for 20+ years. Most compilers are smart and will optimize large if/elseif chains exactly the same way as an else statement - though I would have used a dictionary or array lookup for a lot of the larger chains. The issue has nothing to do with the individual lines of code. If you want to see some truly terrifying code, look at the source for Cataclysm DDA. No, his issue is a simple one -- he knows a little bit about programming, but knows nothing about _design_. His design is crap. But I can confidently say that at a lot of the commercial applications you use (online and on your computer) have code equally as poor as this. I'm not defending the guy as I'm not invested in the whole situation; just speaking up for any coders in the shadows freaking out because their code looks like this as well.
@dudusa34 жыл бұрын
8:30 This claim is not true at all. Not all the ifs are being checked because there is a return in every single one of them so the function terminates after a condition is met. In this case it's bad habbit to use else.
@dudusa34 жыл бұрын
@jshowa o else if would check all of them either way. How would you do that?
@dudusa34 жыл бұрын
@jshowa o Exactly what would happen if you use else if which was the claim in the video... there is no way around it. ifs and not else ifs in multiple checks like that in case of function return value in each of them is more common and more readble. Ofcourse there is no coding convention about that and it's a matter of personal taste. BTW ROOMY commented himself that he had a mistake in this case. The bottom line is that it doesn't matter. It will take the same affect. You can take a look over here: stackoverflow.com/questions/31134835/ifs-else-ifs-and-multiple-returns
@dudusa34 жыл бұрын
@jshowa o Yeah maybe a dictionary would be the way to go. Although it's debatble on whether you'd prefer holding a dictionary in memory or not. If the occurrence of the code is rare I would prefer not to use a dictionary, It won't affect the performance because it's a rather small piece. Truth is we can't know if we don't dive in the code.
@dudusa34 жыл бұрын
@jshowa o Yeah you're most likely right about the dictionary in this case, could put it in SubtitleType it would have been much cleaner. If chains are most likely avoidble (most of the times). In any case Roomy's specific claim was wrong about the fact that all the ifs will run always. Sure you should look for the worst case but the claim was still wrong.
@78anurag3 жыл бұрын
I swear even a guy only knowing basics of python like if and else statements will still have a stroke reading his code.
@sma83574 жыл бұрын
this needs more recognition
@ruchijha53784 жыл бұрын
True
@andys28014 жыл бұрын
Someone buy Yandere Dev’s half baked game and turn it into a somewhat decent game
@DEVDerr4 жыл бұрын
It's not that easy. The core fundamentals in this game are completely fucked up. Wast majority of the game needs to be refactored to make be able to add any new content
@diogoproenca4424 жыл бұрын
i think someone already did that, making a (almost) fleshed out game with better FPS.... but only seen on video + can't find it.... truly sorry, but if you keep laughing at yandereDev BS while watching videos, you might find it
@motoki-trsk4 жыл бұрын
@@diogoproenca442 Did you mean Watashi no Mono?
@diogoproenca4424 жыл бұрын
@@motoki-trsk yeap, that's the one, thanks a lot!
@EnterpriseKnight21 сағат бұрын
You know, I'm starting gamedev and one of the things that I was afraid of was how to approach code optimization. Seeing someone so blatantly fail at this is unexpectedly useful.
@laenprogrammation4 жыл бұрын
piss off with switch case. it is just syntaxic sugar. if/else if is compiled to conditional branching as well. compilers have optimizers for these kind of things. plus switch case is in many situations less readable
@dazeymazey3516dr4 жыл бұрын
Going to put this out there too. Just because not all the code is running, doesn’t mean that the system isn’t still reading everything. A code parser, if the code is junked up, may have to go line by line looking for where the code picks back up. I depends on the compiler, but it often has to make compromises, and yes the goto function is a thing with lower level programming, but if he has so many lines, the compiler is still translating every fucking line to machine level stuff, and the less optimal he writes, the more work the lower level has to do to do basic things. Why check the value of a number at potentially 5 different spots with multiple conditionals when you can take that number and do a smaller bit of math. The computer is MUCH faster at math than logic statements, one line of multiplying is only 1 line of x64 as opposed to the three lines needed for a comparison. This is one of the reasons comparisons are a less viable option in coding. Don’t get me wrong, they have their place and I agree with the vid that having a few else ifs is okay, relying on them as your crutch will cripple your speed. Especially if there’s a math equation or algorithm that can do the job faster.
@markellii30934 жыл бұрын
I remember about a year or so ago remembering how a couple years before that I remembered yanderedev talking about how the game will take longer, I have then checked its current state and I knew this game would never be finished.
@aubymori2 жыл бұрын
lol your youtube bookmark is so old that it still has the "Broadcast Yourself" slogan
@fra345434 жыл бұрын
The first thing I've learned while coding: Less you code, better the program runs.
@GameFuMaster4 жыл бұрын
replacing `if` with switch is slightly better, but the best thing to do is to have an object/hashmap that can assign functions to a variable which can execute that code. I don't do game programming, but I do web development. And I have no idea how you can write 8000 lines of code without wondering how you can break the code up into smaller compartmentalized files for easier understanding of scope.
@erilowrub4 жыл бұрын
Man... I'm not a fully fledged programmer, but when I see people doing these big projects and see how they treat their code like it was spaghetti really bothers me, because logically they're writing the code right, but when the big performance hits come to knock the door, they don't even bother check twice if the code is as efficient as possible. But then again, if the code works, why bother check it out twice, right?
@JoeyTheTricky3 жыл бұрын
This video has single-handedly made me want to go back on working on my dream game project. :)
@omega-max53474 жыл бұрын
He doesn't even have to search for the bad parts. It's everywhere.
@moonkingkei55474 жыл бұрын
I know nothing of how Unity coding works, but at 8:40 I immediately thought, “why even check the StudentID?” Just “return SubtitleType.Task[this.StudentId]line” or however it’s done in Unity, will literally replace all of those lines with just one line.
@eduardokuri19834 жыл бұрын
The guy is so terrified of being perceived as incompetent that he actually id and doesn’t care about it