 What's up guys, my name actually that's that's not go with that Intro now because I realized the YouTube algorithm actually I realized just talking about competitive programming Rather than actually going over problems actually may have to be more views So from now on my intro is gonna be Algorithms data structures. Welcome to CP. Okay, that's that's what my intro is gonna be okay Anyway, today we are not talking about that today. We're going to talk about Why you should write? Unclean code and what I mean by unclean code is that in a in code is really unreadable And I actually am a firm believer of why you should write right? Unclean code is so like if you look at the top CP competitive programmers, especially in in competitive programming, right in competitive programming The faster you solve the problem and pass all the tests the more points you get, right? so We have to think about like why do you want to write clean code in the first place like okay? So when you write clean code in a production side You write clean code because you want to see the code again, right? You want to what? You want to maintain the code so you could add more features to it right now the Differences that is that in production pro programs in production code your coding is generally there to Add more features to maintain the base right so other people your co-workers your boss anyone else could see what your code is doing But in programming contests When you're trying to maximize the number of points you get you don't actually really you don't need to Maintain your code like it's actually it might actually be better if you may have unreadable code Like if you look at the all the top CP programmers a Lot of them use a bunch of macros and a lot of them you it's just not readable, right? None of these are readable, right? You might not you just looking at this is very difficult to understand What's going on right like rep queue? This is a macro retree read graph So on so forth and the reason why they do this is because one They're trying to make the fastest algorithm possible right to pass all the tests Essentially, that's what they're trying to in a minimum number of times So if you're going to try to maximize that you need to you to make all your variable names very short Right because if you make your all your variable names very short you're more likely to Type faster when you're more likely type faster and to your more likely to submit first so if you submit first and you pass all the cases like Maroon and Anta or the meetree, right? You once you submit all very fast and pass the test very fast you get higher points like he got 498 points from this right just from submitting a very fast and when you submit faster You're more up like you're higher up on the rank so you could go on to the next problem faster So it's actually better for you in competitive programming to write Unreadable code code that you don't like other people don't understand You get what I'm saying because if if you think about this if you write unreadable code If as long as you type very fast and you write very fast and to pass the test you get more points So it's better to write unreadable code this way and one thing is that it prevents you from being hacked Like I don't I'm not saying like you just make all your code like which completely unreadable But I'm saying like you shouldn't you don't have to care about if other people are reading it or not Like if if another person's code is very difficult to understand So let's say where let's go up to like this duality, right? Just look how difficult to this code is under actually this is a little bit easy to understand But let's say like the macros is very difficult to understand right the macros actually kind of still could understand a bit but if you look at the macros, this is very difficult to understand and If you're trying to prevent getting hacked, let's say On code forces, it doesn't really matter that much but on an ad coder on not at code on top coder. It does matter, right? If you write code unreadable code That is like very short and kind of very hard to Be able to read it other people can't read it and they can't hack you right So when I say hack is like they could find different test cases to break your code Um, it's actually better in that case to have another person not be able to read it because you're less like get hacked And the problem is that like if if you do get hacked you means that you Ideally like I think if when you get hacked, I don't think you could submit again, but I could be wrong so when you get hacked on top coder or stuff like that you lose points and then You just can't submit it in the end. So it's actually better to have unreadable code. So you More likely not to get hacked. Ideally, if you write perfect code You wouldn't get hacked in the first place because like your code is fine But this is just like a tip for like all the great coders out there who's trying to increase your ranking But I digress That's pretty much the reason why I believe in competitive program. You should write unreadable code The two main reasons is one is that you're there's no reason to maintain the code No one else is we're gonna really read it You're not gonna build like a new feature of it and you're not really you're not getting paid to do anything, right? So it's unless you're trying to win a prize But regardless your code once you write it you submit it and you just throw it away So in the first place, there's no reason to maintain and no reason to have long variable names There's no reason for any of that. You're just trying to get the most amount of points possible So your code could be completely garbage. That's what I mean That's actually a good thing. It helps you helps you get higher points and increase to the ranking If your goal is to get higher ranking, it makes more sense to have your code very unreadable I'm very short and very difficult to read no long variable name stuff like that Another thing is that if you do failure the system tests as in your code didn't pass all the cases To prevent getting hacked having unreadable code like stops you from getting hacked So from losing more points, especially on top coder and stuff But yeah, that's basically my main reasons why I think how unreadable code is a is a good thing Ray come subscribe. I'll check you guys later. This was a pretty short video because like I don't I felt bad not being able to upload So I might as well make this video. Yeah, Ray come subscribe. I'll check you guys later. Peace