Man, i used to name the variable that held the maximun with "min" and the one that held minimun with "max" just to fuck with whoever was grading my code
0:17 actually makes sense. This is sometimes used to force hardware acceleration on an element by giving it a tiny amount of depth. Very useful when you have a 2D element that then becomes 3D through an animation of some kind.
@@haniyasu8236 it's usually going to be much faster to assume something is 2D unless specified otherwise, and I wouldn't trust developers to correctly specify. This is fine in my book.
So, this is why my laptop can't run 2d games that look simpler then my file manager. Somebody "assumed" that it would be faster if my integrated gpu will do 3d instead of 2d graphics. Thank you very much.
I still remember that time I can't stop myself from laughing uncontrollability when a student sits in front of me making a "blinking LED" by copy and paste thousand lines of code lol
My first program task in my university was sort of "print only numbers from 1 to 1000 that match some conditions I forgot". That was an extremely easy task so instead of printing normal answer I modified it to print actual code looked like " writeln(23); writeln(25); etc..." and use it to make this long program that do the output I needed. That was so funny to look at shocked teacher cause for a second he thought I wrote it manually.
That's exactly it. When an element moves from having a transformon it to not, it changes the rendering and makes the edge aliasing look different. Sticking a low translate Z on elements that will have translate on them at some point works around that.
Actually though, last I heard, his code was pretty optimized, and the game only ran like shit because of rendering load from random things having way too high poly counts and time being spent rendering things that were behind walls relative to your viewport.
@@shred1894 "his code was pretty optimized" That statement alone gives me motivation to open his buggy mess of a game in DnSpy and see if he actually optimized something.
@@shred1894 Time isn't the only metric by which you evaluate code. It needs to be readable, documented, and well structured to make additions to the project simple. Probably why yandev is so slow at developing the game. His lack of knowledge regarding the switch statement is just a simple example of how truly lost he is.
@@viktor8986z7o Re-read my comment because I wasn't using time as a metric for anything. I was saying that it was rendering things that weren't in view, which when paired with high-poly-count objects, can result in poor framerates.
i remember the sonic team back when sega was an actual competitor to nintendo have done something to the likes of 1:20 when they've had to present a mostly functional demo that had to have a fast framerate and don't crash, they've made the fps counter do exactly that and whenever the game would've crashed it would go back to the menu to continue their presentation. it worked flawlessly despite 1 or 2 "crashes" happening during the presentation.
1:40 omg I recognize that one, brings back so many memories. This blueprint was actually for an upgrade shop system, where the branches are actually a giant else/if chain checking for every upgrade id than applying it along with repeated nodes for checking the player's balance and deducting from it. I only found it while browsing the project looking for an unrelated bug and figured I would share this blueprint by a colleague when I saw it (no NDA was in place). To this day I don't blame him though. the crunch was insane. I still have the UE project somewhere on my pc.
0:54, I immediately recognized which program this was made for. It was created to test the program we developed for our semester project at the Slovak Technical University
Two things: First, as someone completely self taught with little to no hope of ever landing a job, I'm proud I understood about half of these. Second, I'm proud I've made optimized versions of SEVERAL of these.
0:54 ... comments are in Slovak and extremely (un)helpful: 0: terminate program 1: reading of pre-defined map 2: way there and back 3: 5 princesses 4: test for ideal walk-through 5: dragon does not exist 6: princesses do not exist 7: princess unavailable (and functio... 8: killing of dragon unattainable within time limit ..... (stihnout=to make in time, nestihnutelné=can't be make in time ... english does not have word for this?) 9. test 100x100 map, 3 princesses 10. 100x100 with one princess 11. pillar/column
I've sadly seen some of these things at work before. There's also a guy who did SELECT * all the time, never used WHERE and instead looped through everything to find what he wanted... he also never used break once he had what he wanted, he just used if-statements to see if we had enough items. There was also a sign up form for some stuff where the year was set to 2021, I had to change it to 2022 last year and I've changed it to 2023 this year. There are reasons why we can't just use the real date, but I honestly just want to add a config variable for it so I don't have to adjust in code. Oh, and the reason why I haven't is simply because I don't get paid to do it, so I'm also not allowed to do it.
My favorite programming war crime I ever saw was a giant bitwise operation with what had to be at least 40 or 50 clauses. Above it, like a drunken guard, stood a single inline comment: // lol
Let me play a lawyer: 0:05 Can be very useful. Compiler does not scream about unhandled cases. No break point needs to be added explicitly. 0:17 Described above. 0:51 If you use obfuscation it may be important to note not to use reflection. But in this case it’s about reversed engineering attack. 1:21 This line can be useful to guarantee game simulation determinism. Not optimisation though.
@@r.t.5767 I can see how this particular instance is a joke but it's what developers actually do :/ Just months ago I played a unity game and complained about bugs to the developer, turns out it's because of my 144 Hz monitor - the game was only ever tested on 60 Hz and is meant to run at 60 fps (scaling by deltatime is too hard). So the dev just locks it to 60 frames in the next day's patch.
@@SyedAshrafulla `assert(false)` is actually quite useful to mark 'unreachable code'. In debug mode a message is emitted, and you can figure out that your unreachable code is maybe not that unreachable after all.
here you can understand why copilot or other ai's are still barely decent... because this code is in their dataset and they have to waste time on it before understanding them and filter them (or not)
While some examples had been not great - a lot of examples actually are totally fine. Author of this vid seems like is not very experienced. IMHO to be considered "crime" it really must be something that by nobody in none of cirumstance could be considered good, stuff like False=true.
1:51 inpt = input rehnj (レンジ = microwave) = range number = int(inpt()) ru = 0 for i in rehnj(2, 2**number): nn=f'{i:b}'.count('1'); ru+=all(nn%ji for ji in rehnj(2, int(nn**0.5)+1)) and nn>1 inpt(ru)
first one made me stop for a second, because this is common for enums and I was like "that's not really wrong depending on the context"..... then I realized they were strings
1:05 some of these crimes are hard to see on mobile screens without better cloesup. And a ez editing trick is to show small part of long scratch/code earlier in vid then keep zooming out every 30 seconds for payoff
0:00 Fun fact: In my final year as a software dev student, a friend of mine wrote his code exactly like this. He worked for the same 1-man-company in both of his internships, which was run by an old man who had done some Pascal in his youth and never touched programming again. Told him in his interview "Just write this program I want, and if it compiles at the end of your internship I'll give you an A". I tried to convince him the entire year that this was probably not the most optimized way of doing this, but he refused to see reason. 1:50 Fun fact 2: At the company I work at now, one of our clients writes all of their code in Mandarin Chinese or something. When I still did tech support, the same dev kept contacting me with screenshots of his code and I kept telling him that I can't help him, because I don't speak Chinese (he did speak a little broken english, which is why we were somewhat able to communicate), but he never understood why I couldn't read his code. People in tech support, get the f out of there, preserve your braincells like I did.
Just earlier tonight, I was in vc with some friends and one of them was working on a python assignment for a class and was screen sharing. He was asking for help and I looked at his screen to see he was writing it in Google docs and then compiling it. Since there were a couple people familiar with at least the basics of coding including me, he now has vscode.
At my internship we did something similar to the code at 1:25. We had to decide a random number between 1-10 and one of the developers got assigned the task and chose 3 after typing "Random number between 1-10" into google.
0:05 actually makes sense. I do this in my code sometimes to make sure that the unexpected case doesn't happen. Depending on the language, this may even be the only way to make sure you handle all cases in a switch on an enum, especially as you add new values to the enum.
@@sprytnychomik It probably doesn't matter if the exception appears or disappears in the compiled code, eh? Exceptions are for exceptional matters, it will probably never get reached the majority of time, and if control flow does reach it once in a while by bad luck it's good to have the Exception to crash the app at the location of failure. Anyway, if it really must be done, at least wrap "Assert.IsFalse(true)" in a utility method and call it "fail()" or "AssertNever()" or something like that, the name serves as an explanation of what the piece of code is doing and why.
True. It made me wonder whether or not some of the previous examples I didn't understand weren't bad code but based on more obscure programmer memes. (Odds are, the former.)
Security through obscurity is actually how most modern locks work. It's extremely easy to break or pick most locks but we are protected by purposeful suppression of information
0:55 is much better when you understand the comments; princess not exist, journey there and back, dragon not exist, loading the map, princess not available, not enough time to kill dragon...
The first one actually makes sense for languages that don't store runtime information such as a reflection/evaluation (typically low-level ones). Even though it is usually getting solved by using oop paradigm, preprocessor hacky things, hash tables and so on, the code showed in this video is a simple, easy to debug and read implementation in a functional style. Not that really bad
@@OniKrisNeptune In this case we’re executing a function based on the input. I’d probably create a map with key of type string and value of a function and store it in that. It would lead to a constant time since it just has to do a hash lookup compared to the O(n) time that the switch statement has. Depending on the language using functions as objects isn’t as simple so this is likely to happen if someone’s still learning or hasn’t been exposed to multiple types of language.
nope, it doesn't. It doesn't require reflection nor evaluation, you only need function pointers or references of any kind and a lookup table data structure, which 95% of languages have natively, and the remaining 5% of languages is COBOL and brainfck.
What does that last program do? I've been staring at it for a while and I can't figure it out. It's very slow for n>20. Currently working on optimizing it so I can plot the output.
The algorithm has a time complexity of O(2^n), so each increment of n by 1 more than doubles the execution time. Maybe this pseudo-code helps: x = 0 for each integer i in [2, 2^n): k = number of 1s in the binary representation of i increment x if k is not a multiple of any integer j in [2, sqrt(k)]
@@WhaleIsOnline This is fairly easy to solve, but it's mostly a math problem not a cs problem. First, the most 1s that a number up to 2^n could have is n, so we need to find all primes up to n. Then, for each prime p, we can count the number of primelovers with p 1s by calculating (n choose p). So the number of primelovers up to 2^n is just sum((n choose p) for p
Depends on the programming language. Most compiled languages like C++ cannot do "reflection" without an extended/third-party library, so what you see in the video is realistically the only way to handle it in a way that's readable and easy to communicate what you were trying to accomplish. Interpreted languages like Python can usually handle reflection and don't need to do this roundabout method.
I legit thought it was a code along of a game called war crimes. However, what I got was not disappointing at all. If anything, this was one of the most relatable videos I have ever watched.
0:05 makes sense for testing purposes 0:25 makes sense to test path travelsal vulnerabilities 0:30 makes sense for shape coding, like the donut shape code Rest not much 😅
Dumb question but could somebody explain the right way to do 0:00 to me? The way I would have done it was type a single line Invoke("stringcase", 0); but I just assumed Invoke(); could be considered slower than this. Is there a better way than both of those?
If true = false. Lets think about this logically. Wouldn't the fact that true = false itself be false but again something that is false is true. Makes my head hurt. It would mean something is factually inaccurate and completely inaccurate that the same time.
1:10 ive actually done something like this before, basically when testing out a while loop and it iterates way too many time than expected just write a line that will make the program instantly crash rather than having to close it while its trying to run an infinite loop
0:00 Honestly I'll rather have this than some wacky inheritance stuff, you could obviously add smth like function pointer but It does it's job and is readable.
@@else1f Well, I guess I should've specified the language, for me I am learning C, so I don't know what that is and I don't think C has anything similar.
I thought this was going to be about coding a program that commits warcrimes
C++ Tutorial: How to create malware to gain access to the United States nuclear missile launch systems, Intermediate difficulty
That's called Excel vba
ever heard of a game called "Rimworld" then :D
Exactly
tbh same
Thank you for the programming tips, i will use it for my final year project
Oh hell nah 💀
People have been judged in Nuremberg for less than that
Man, i used to name the variable that held the maximun with "min" and the one that held minimun with "max" just to fuck with whoever was grading my code
Oh it will be your *final year* alright!
The way to get an A on any project
true = false
Nope you got it wrong. It was true = false and next line false = true... At least in Boolean world...
well yes but actually no
i freakin lost at this part
When time is 100 the world shall break and ALL SHALL BE FALSE!!!
That actually suppose to destroy all the binary logic computing technology is based upon
1:01 least obscure/complicated regex statement
Comeon regex isnt THAT bad
@@viceagain7335 "The plural of regex is regrets" - Alan Turing
@@nullFoo its turing it Gotta be true
@@nullFoo Holy that is so good. Almost as good as "dreams are just VMs for brains" I saw a week ago.
@@ShimizuSolace Dreaming is cleaning the garbage collector
This video is literally my first week in my "self learning" of C++
I've also decided to start learning C++ the same way! Are you using a course or YT tutorial video?
Everyone makes horrifying code when they’re trying to learn! it’s the only way to improve. Done the same with rust recently
@@hermes1873 Self learning taught me the best tbh, I just looked through GitHub source codes
@@joshuafountain I'll keep that in mind, thanks
@@hermes1873 The Cherno is the best source on C++ on UA-cam
I fucking died on the "I SOLVED OUR OPTIMIZATION PROBLEM!"
i bet that would work though xD
@@ninocraft1it would work, as long as the game doesnt lag
Vsync be like
that fucking 2-space Whitesmiths indentation is the icing on the cake
@@ninocraft1 I think the funny thing is that there is no sense to check the fps rate with an if
0:17 actually makes sense. This is sometimes used to force hardware acceleration on an element by giving it a tiny amount of depth. Very useful when you have a 2D element that then becomes 3D through an animation of some kind.
Thanks for the tip if I ever have headaches doing that. LOL.
so the perpetrator of the war-crime wasn't the programmer, but the web-engine designer
@@haniyasu8236 it's usually going to be much faster to assume something is 2D unless specified otherwise, and I wouldn't trust developers to correctly specify. This is fine in my book.
So, this is why my laptop can't run 2d games that look simpler then my file manager. Somebody "assumed" that it would be faster if my integrated gpu will do 3d instead of 2d graphics. Thank you very much.
@@rogo7330 Unless you're playing a shitty browser game, no.
I still remember that time I can't stop myself from laughing uncontrollability when a student sits in front of me making a "blinking LED" by copy and paste thousand lines of code lol
That led has to blink VERY precisely, has to sync up to a gps satellite yknow?
My first program task in my university was sort of "print only numbers from 1 to 1000 that match some conditions I forgot". That was an extremely easy task so instead of printing normal answer I modified it to print actual code looked like "
writeln(23);
writeln(25);
etc..."
and use it to make this long program that do the output I needed.
That was so funny to look at shocked teacher cause for a second he thought I wrote it manually.
@Aneugene to be fair, i have seen people do that so the professor's shocked face is probably justified lol
@@Epsicronics that was class task for 15 minutes so it was pretty hard to manually type ~700 lines of code in that time
@@Aneugene Hasn't stopped people from trying lol
1:20 made me lose it, if only it were that easy.
💀
Infinite fps glitch
What? I thought the joke was the bad indentation.
The code basically says if the FPS variable doesn’t equal sixty, set it to sixty, instead of actually optimising the code.
@@agentnull5242 Wow, mind blown.
As someone who was afflicted by CSS, translateZ(0.001px) sounds normal, like the sort of thing which somehow fixes a browser rendering bug.
That's exactly it. When an element moves from having a transformon it to not, it changes the rendering and makes the edge aliasing look different. Sticking a low translate Z on elements that will have translate on them at some point works around that.
Real problem I saw was that multiple units were used for transformations: 'em', 'no units', 'px'. WHY!?
The real problem is using pixel values bellow 1
Like, how it's something smaller than a pixel?
@@crypticlol Internally, css uses floats and pixels just a unit. Having the z translation greater than 0 point whatnot forces hardware acceleration
@@kevin0xf681 Interesting
1:05 it's amusing how every Scratch application is seen as a crime. 😅
I think its more about how the variables are emojis.
@@BrainiacManiac142 right
@@BrainiacManiac142 didn't even notice that, impossible to see in low quality mobile
@@BrainiacManiac142 should’ve included swift
Every middle schooler-I mean scratch programmer clinching their teeth...
0:40
P.S. Translation:
Secrets of Python: 59 recomendations for writing the most effective code by Yandex
Man, it's all Russians, we're just Pretending
60-й совет идет по подписке Яндекс +?
I love how these abhorrences can be zoomed into like fractals. Almost feels like you could fall into the monitor and never be seen again around town.
1:10 I'm retiring from programming.
what about the else if one jesus lmao the amount of ))))))))))))))))))))))))))))))))))))))))
What about 1:29
at the end of time there will be no more duality
the alpha and the omega
is your statement true or false?
1:20 the user will never find out 🤭
At least the ‘fps’ var is stable😂
lol so good. this incredibles soundtrack never gets old, lol.
Yandev's entire coding expertise condensed into one video.
Actually though, last I heard, his code was pretty optimized, and the game only ran like shit because of rendering load from random things having way too high poly counts and time being spent rendering things that were behind walls relative to your viewport.
@@shred1894 "his code was pretty optimized" That statement alone gives me motivation to open his buggy mess of a game in DnSpy and see if he actually optimized something.
Nah because he wouldn't use the switch statement
@@shred1894 Time isn't the only metric by which you evaluate code. It needs to be readable, documented, and well structured to make additions to the project simple. Probably why yandev is so slow at developing the game. His lack of knowledge regarding the switch statement is just a simple example of how truly lost he is.
@@viktor8986z7o Re-read my comment because I wasn't using time as a metric for anything. I was saying that it was rendering things that weren't in view, which when paired with high-poly-count objects, can result in poor framerates.
These will never get old
i remember the sonic team back when sega was an actual competitor to nintendo have done something to the likes of 1:20 when they've had to present a mostly functional demo that had to have a fast framerate and don't crash, they've made the fps counter do exactly that and whenever the game would've crashed it would go back to the menu to continue their presentation. it worked flawlessly despite 1 or 2 "crashes" happening during the presentation.
"Welcome to Sonic Team! We make games, I think!"
Ah yes, the classic "Volkswagen Method", genius
1:40 omg I recognize that one, brings back so many memories.
This blueprint was actually for an upgrade shop system, where the branches are actually a giant else/if chain checking for every upgrade id than applying it along with repeated nodes for checking the player's balance and deducting from it. I only found it while browsing the project looking for an unrelated bug and figured I would share this blueprint by a colleague when I saw it (no NDA was in place). To this day I don't blame him though. the crunch was insane.
I still have the UE project somewhere on my pc.
0:54, I immediately recognized which program this was made for. It was created to test the program we developed for our semester project at the Slovak Technical University
Shouldnt let them know where it came from Jano....
True = false... Masterpiece, a work of art !
What about .isFalse(true)
@@dumpsockpuppet5619 True! Oh, I mean false.
thats how universe will end
1:10 The greatest example of dictatorship
The regex at 1:00 is so beautiful it brought tears to my eyes! It's truly a work of art.
yeah, it really tore your eyes
I've started to learn programming to understand these shenanigans
You know, sometimes you get to a point where you arent scared anymore, but just fascinated
Two things: First, as someone completely self taught with little to no hope of ever landing a job, I'm proud I understood about half of these. Second, I'm proud I've made optimized versions of SEVERAL of these.
as someone who knows nothing about programming and has even failed the course at my university, I absolutely agree
ok but the breakpoint on every line hits hard tho
0:15 well, translateZ(0) enables the GPU in CSS, it makes the 3D transform less blurry
Bro he included the ‘px’ suffix when the input was integer
@@asddsaasdfg2846 aaah, if that's a problem. So probably he didn't know that he could just use 0,but he didn't want to make it actually translated
@@thegate8985 It might be an old exploit to get around a problem tho because that language didn’t seem familiar
@@asddsaasdfg2846 yea, there are some direct properties for that, but still, I wanted to guess what that person tried to do with that
@@thegate8985 To be silly, no way exception than it.
0:54 ... comments are in Slovak and extremely (un)helpful:
0: terminate program
1: reading of pre-defined map
2: way there and back
3: 5 princesses
4: test for ideal walk-through
5: dragon does not exist
6: princesses do not exist
7: princess unavailable (and functio...
8: killing of dragon unattainable within time limit ..... (stihnout=to make in time, nestihnutelné=can't be make in time ... english does not have word for this?)
9. test 100x100 map, 3 princesses
10. 100x100 with one princess
11. pillar/column
Disclaimer: Code reviewers may have been harmed during this video.
My guy really wrote all the variables in katakana
Not entirely
数 - kanji
ん - hiragana
There's a lang typed in kana for that, only missing kanji since kanji lingo are obscure
The music is the best part. Like we've all seen things like this, but never with that music. Love it.
1:31 python programmers using another language
I've sadly seen some of these things at work before. There's also a guy who did SELECT * all the time, never used WHERE and instead looped through everything to find what he wanted... he also never used break once he had what he wanted, he just used if-statements to see if we had enough items.
There was also a sign up form for some stuff where the year was set to 2021, I had to change it to 2022 last year and I've changed it to 2023 this year. There are reasons why we can't just use the real date, but I honestly just want to add a config variable for it so I don't have to adjust in code. Oh, and the reason why I haven't is simply because I don't get paid to do it, so I'm also not allowed to do it.
I know next to nothing about programming but this makes all of my bones feel a certain way, and that way is definitely not good
I don't know a huge amount about programming, but I know enough to see that a lot of these are indeed crimes against humanity.
My favorite programming war crime I ever saw was a giant bitwise operation with what had to be at least 40 or 50 clauses. Above it, like a drunken guard, stood a single inline comment:
// lol
love the incredibles music makes it so much funnier
that regex one gave me a heart attack
A switch statement with fewer than 20 cases is considered by many to be a dull affair.
Let me play a lawyer:
0:05 Can be very useful. Compiler does not scream about unhandled cases. No break point needs to be added explicitly.
0:17 Described above.
0:51 If you use obfuscation it may be important to note not to use reflection. But in this case it’s about reversed engineering attack.
1:21 This line can be useful to guarantee game simulation determinism. Not optimisation though.
1:21 is obviously a joke
0:05 you're playing a real shady lawyer with that response.
what about 0:00?
@@r.t.5767 I can see how this particular instance is a joke but it's what developers actually do :/ Just months ago I played a unity game and complained about bugs to the developer, turns out it's because of my 144 Hz monitor - the game was only ever tested on 60 Hz and is meant to run at 60 fps (scaling by deltatime is too hard). So the dev just locks it to 60 frames in the next day's patch.
@@SyedAshrafulla `assert(false)` is actually quite useful to mark 'unreachable code'. In debug mode a message is emitted, and you can figure out that your unreachable code is maybe not that unreachable after all.
here you can understand why copilot or other ai's are still barely decent... because this code is in their dataset and they have to waste time on it before understanding them and filter them (or not)
While some examples had been not great - a lot of examples actually are totally fine. Author of this vid seems like is not very experienced. IMHO to be considered "crime" it really must be something that by nobody in none of cirumstance could be considered good, stuff like False=true.
1:51
inpt = input
rehnj (レンジ = microwave) = range
number = int(inpt())
ru = 0
for i in rehnj(2, 2**number):
nn=f'{i:b}'.count('1');
ru+=all(nn%ji for ji in rehnj(2, int(nn**0.5)+1)) and nn>1
inpt(ru)
first one made me stop for a second, because this is common for enums and I was like "that's not really wrong depending on the context"..... then I realized they were strings
1:05 some of these crimes are hard to see on mobile screens without better cloesup. And a ez editing trick is to show small part of long scratch/code earlier in vid then keep zooming out every 30 seconds for payoff
0:00 Fun fact: In my final year as a software dev student, a friend of mine wrote his code exactly like this. He worked for the same 1-man-company in both of his internships, which was run by an old man who had done some Pascal in his youth and never touched programming again. Told him in his interview "Just write this program I want, and if it compiles at the end of your internship I'll give you an A". I tried to convince him the entire year that this was probably not the most optimized way of doing this, but he refused to see reason.
1:50 Fun fact 2: At the company I work at now, one of our clients writes all of their code in Mandarin Chinese or something. When I still did tech support, the same dev kept contacting me with screenshots of his code and I kept telling him that I can't help him, because I don't speak Chinese (he did speak a little broken english, which is why we were somewhat able to communicate), but he never understood why I couldn't read his code. People in tech support, get the f out of there, preserve your braincells like I did.
0:30 That looks like it was for the obfuscated C contest, where the look of the code is part of the score.
I love the infinite nests at 0:44 the way it is blurry and obscure, it feels like a true Lovecraftian cosmic object floating somewhere in space. :D
Just earlier tonight, I was in vc with some friends and one of them was working on a python assignment for a class and was screen sharing. He was asking for help and I looked at his screen to see he was writing it in Google docs and then compiling it.
Since there were a couple people familiar with at least the basics of coding including me, he now has vscode.
You've made us all a horrible disservice.
@@Lemon_Inspector My bad, should I have explained the virtues of the open source project vscodium, or simply told him to get good and use vim?
Bruh, Python is not even compiled
@@segfaultthis python is compiled into bytecode, then interpreted by the CPython interpreter
Didn't even know that compilers work with Google docs files.
At my internship we did something similar to the code at 1:25. We had to decide a random number between 1-10 and one of the developers got assigned the task and chose 3 after typing "Random number between 1-10" into google.
Lmao
Where is Yandere Simulator’s code?
And all of undertales code
1:10
"This... Statement... Is... False! (don't think about it, don't think about it, don't think about it!)"
"Um, true, I'll go with true."
0:05 actually makes sense. I do this in my code sometimes to make sure that the unexpected case doesn't happen. Depending on the language, this may even be the only way to make sure you handle all cases in a switch on an enum, especially as you add new values to the enum.
True, but in that case you should throw an error properly instead of making a purposely failed assertion.
@@salmon4402 Change to 'release' build and assertion disappears (at least it should). Throw does not.
@@sprytnychomik Ig, but if the branch isn't supposed to be reached then you should fix it for the release build in the first place
@@sprytnychomik It probably doesn't matter if the exception appears or disappears in the compiled code, eh? Exceptions are for exceptional matters, it will probably never get reached the majority of time, and if control flow does reach it once in a while by bad luck it's good to have the Exception to crash the app at the location of failure.
Anyway, if it really must be done, at least wrap "Assert.IsFalse(true)" in a utility method and call it "fail()" or "AssertNever()" or something like that, the name serves as an explanation of what the piece of code is doing and why.
@@salmon4402 Exactly. And how to (easily) check if it was or wasn't reached (keeping check in the code, but only in the 'debug' version)?
my senior's comment on my PR: "can you add some documentation for these?"
me: 0:50
that's an absolute cheat code
our dev team is currently working tirelessly to fix this problem, thanks! :D
Oh god it makes me feel so much better as an enthusiast dev. The music is amazing lmao.
it really shows how much of an amateur I am cause I only understood like half of these
"True = False" is like the newest Nolan's movie plot
I have never programmed like this and I am terrified by people who do.
1:20 "you can't miss when there's only one option"
1:20 this is more to a meme than to a crime lol
True.
It made me wonder whether or not some of the previous examples I didn't understand weren't bad code but based on more obscure programmer memes.
(Odds are, the former.)
Security through obscurity is actually how most modern locks work. It's extremely easy to break or pick most locks but we are protected by purposeful suppression of information
The very first one can be more cursed.
In Lua you can use loadstring/load to *straight up run a string as code.* This is as cursed as you think.
Well maybe it was C code.
1:05 I love how the music intensifies on that part! Truly the biggest war crime out of all!
I 100% thought this was about programming AI to commit war crimes in a video game (the unreal engine thumbnail)
'true = false' is truly one of the lines of code of all time
I thought this video was going to be about simulating war crimes with code...
It did. Did you not watch it?
Watched 5 minutes of unskippable ads for 2 minutes of content, worth it.
0:40 , ive seen a friend new to programming do this. It hurted me physically and mentally
You saying "hurted" hurt me significantly.
@@kasiphia hurted*
@@Takyodor2 "The past tense of 'hurt' is 'hurt'. It is considered poor English to say “hurted”."
@@kasiphia I know, I just thought it was funny (the part where he hurted you significantly with incorrectly grammaring).
the number of switch cases is crazy...the indentations on the if else's make my heart hurt bro
This is making me feel psychological and physical pain
0:55 is much better when you understand the comments; princess not exist, journey there and back, dragon not exist, loading the map, princess not available, not enough time to kill dragon...
1:44 yanderedev be like
0:35 that is the work of a person who just simply cannot be bothered.
That is literally the worst offense in this whole video.
The first one actually makes sense for languages that don't store runtime information such as a reflection/evaluation (typically low-level ones). Even though it is usually getting solved by using oop paradigm, preprocessor hacky things, hash tables and so on, the code showed in this video is a simple, easy to debug and read implementation in a functional style. Not that really bad
whats the actually correct way to do that?
@@OniKrisNeptune In this case we’re executing a function based on the input. I’d probably create a map with key of type string and value of a function and store it in that. It would lead to a constant time since it just has to do a hash lookup compared to the O(n) time that the switch statement has. Depending on the language using functions as objects isn’t as simple so this is likely to happen if someone’s still learning or hasn’t been exposed to multiple types of language.
@@jonstewart5525 Switch statement is optimised to O(1) in some languages (gcc compiler in C definitely does this for example)
@@OniKrisNeptune Passing apparently random function pointers around works. I have seen people argue that with how OOP is defined C is an OOP Language.
nope, it doesn't. It doesn't require reflection nor evaluation, you only need function pointers or references of any kind and a lookup table data structure, which 95% of languages have natively, and the remaining 5% of languages is COBOL and brainfck.
The thumbnail.pztrified me
I thought it was about war crimes and how to streamline your atrocities in times of war.
These make me feel better about my programming skills
What does that last program do? I've been staring at it for a while and I can't figure it out. It's very slow for n>20. Currently working on optimizing it so I can plot the output.
The algorithm has a time complexity of O(2^n), so each increment of n by 1 more than doubles the execution time.
Maybe this pseudo-code helps:
x = 0
for each integer i in [2, 2^n):
k = number of 1s in the binary representation of i
increment x if k is not a multiple of any integer j in [2, sqrt(k)]
@@WhaleIsOnlineSo you admit to the crime!
@@WhaleIsOnline What do I get for keeping quiet?
@@WhaleIsOnline I'd like to see you try.
@@WhaleIsOnline This is fairly easy to solve, but it's mostly a math problem not a cs problem. First, the most 1s that a number up to 2^n could have is n, so we need to find all primes up to n. Then, for each prime p, we can count the number of primelovers with p 1s by calculating (n choose p). So the number of primelovers up to 2^n is just sum((n choose p) for p
1:00 that regex gonna filter out an atom.
What is the correct way of the first one?
id make it a map of strings and callables, but theres probably a better way than that
Depends on the programming language. Most compiled languages like C++ cannot do "reflection" without an extended/third-party library, so what you see in the video is realistically the only way to handle it in a way that's readable and easy to communicate what you were trying to accomplish. Interpreted languages like Python can usually handle reflection and don't need to do this roundabout method.
I legit thought it was a code along of a game called war crimes.
However, what I got was not disappointing at all. If anything, this was one of the most relatable videos I have ever watched.
Oh shit, this is just like a video i made last month, congrats brother we shall harvest these views together 🤝
Screw it, this inspired me to make a part 2
oh shit, that's just like a video i made 6 months ago.
@elseif damn lmao? I have a hoard of like 300 of these type of screenshots if you're interested
Oh shit, is formula: "screenshots with dramatic music" really original enough for this thread to exist lol? (vid is still funny tho :D)
that blueprints graph is the most beautiful thing i've ever seen
0:05 makes sense for testing purposes
0:25 makes sense to test path travelsal vulnerabilities
0:30 makes sense for shape coding, like the donut shape code
Rest not much 😅
0:30 is a coin, you can see it in the code itself
it's the eye of wisdom!
0:15 is an old hack that made browser use GPU instead of CPU for animation purposes.
@@Alexey65536 so you needed to include ‘px’ and ‘em’ suffixes?
@@asddsaasdfg2846 em and px are just different CSS units.The translateZ by a small value here is the hack to trigger the gpu acceleration
nice programming tutorial. Yesterday i was hired as middle developer thanks to this videos.
0:10 POV: forgot a semicolon
Whenever i code, i ALWAYS make sure my code looks something like that even if the code never gets to run, just to annoy people looking jnto the code
Dumb question but could somebody explain the right way to do 0:00 to me?
The way I would have done it was type a single line Invoke("stringcase", 0); but I just assumed Invoke(); could be considered slower than this.
Is there a better way than both of those?
literally just
const functions = { func1, func2, func3,... }
functions[functionName]()
1:11 "when time comes, truth will no longer exist"
powerful
I didn't get the dijkstra one (please explain!) but otherwise this is one of the scariest videos I've ever watched
@@sodachi9464 you use a debugger? Subscribed
@@sodachi9464 it’s nice to hear I’m not the only one. So many devs today think debuggers are useless. I can’t understand it.
@@TimMattison what devs think that? Not using debugger at all is incomprehensible to me
@@sodachi9464 I though it was a did where someone deleted the function
As someone who doesn't know much about programming, this is still hillarious.
The 'true = false' thing has me questioning some people's sanity. Hope that's a joke.
It wouldn’t compile anyway
If true = false.
Lets think about this logically. Wouldn't the fact that true = false itself be false but again something that is false is true.
Makes my head hurt. It would mean something is factually inaccurate and completely inaccurate that the same time.
That regex is awesome. The power of Unix is such that taht will probably work and do exactly what he wanted it to.
blame the intern
Yes. Then slink away. ( ´・・)ノ(._.`)
1:10 ive actually done something like this before, basically when testing out a while loop and it iterates way too many time than expected just write a line that will make the program instantly crash rather than having to close it while its trying to run an infinite loop
0:00 Honestly I'll rather have this than some wacky inheritance stuff, you could obviously add smth like function pointer but It does it's job and is readable.
global[fn]()
I am still learning programming so I was wondering how else can it be done ?
@@Al-Mokadimah check above
@@else1f Well, I guess I should've specified the language, for me I am learning C, so I don't know what that is and I don't think C has anything similar.
@@Al-Mokadimah there's no good way to do it in c other than a lookup table
This is why in the past 40 years of hardware improvements, nothing really seems faster or better really.