I thought this was going to be about coding a program that commits warcrimes
@ForTheOmnissiah Жыл бұрын
C++ Tutorial: How to create malware to gain access to the United States nuclear missile launch systems, Intermediate difficulty
@TheNewton Жыл бұрын
That's called Excel vba
@juansnyders7323 Жыл бұрын
ever heard of a game called "Rimworld" then :D
@deltamico Жыл бұрын
Exactly
@HealthXPotions Жыл бұрын
tbh same
@2OV5 Жыл бұрын
Thank you for the programming tips, i will use it for my final year project
@Mikelica69 Жыл бұрын
Oh hell nah 💀
@mart6792 Жыл бұрын
People have been judged in Nuremberg for less than that
@vasilevasilescu8199 Жыл бұрын
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
@CosmiaNebula Жыл бұрын
Oh it will be your *final year* alright!
@Onyxle Жыл бұрын
The way to get an A on any project
@DoodleChaos11 ай бұрын
true = false
@alvydasjokubauskas258710 ай бұрын
Nope you got it wrong. It was true = false and next line false = true... At least in Boolean world...
@GRIMHOOD999 ай бұрын
well yes but actually no
@freakfreak7868 ай бұрын
i freakin lost at this part
@nestharus7 ай бұрын
When time is 100 the world shall break and ALL SHALL BE FALSE!!!
@CapralHarrison3 ай бұрын
That actually suppose to destroy all the binary logic computing technology is based upon
@Gian69 Жыл бұрын
1:01 least obscure/complicated regex statement
@viceagain7335 Жыл бұрын
Comeon regex isnt THAT bad
@nullFoo Жыл бұрын
@@viceagain7335 "The plural of regex is regrets" - Alan Turing
@viceagain7335 Жыл бұрын
@@nullFoo its turing it Gotta be true
@ShimizuSolace Жыл бұрын
@@nullFoo Holy that is so good. Almost as good as "dreams are just VMs for brains" I saw a week ago.
@PySnek Жыл бұрын
@@ShimizuSolace Dreaming is cleaning the garbage collector
@edwin3928ohd Жыл бұрын
This video is literally my first week in my "self learning" of C++
@hermes1873 Жыл бұрын
I've also decided to start learning C++ the same way! Are you using a course or YT tutorial video?
@BenClementt Жыл бұрын
Everyone makes horrifying code when they’re trying to learn! it’s the only way to improve. Done the same with rust recently
@joshuafountain Жыл бұрын
@@hermes1873 Self learning taught me the best tbh, I just looked through GitHub source codes
@hermes1873 Жыл бұрын
@@joshuafountain I'll keep that in mind, thanks
@leonardodavinci4259 Жыл бұрын
@@hermes1873 The Cherno is the best source on C++ on KZbin
@aspoopypixel Жыл бұрын
I fucking died on the "I SOLVED OUR OPTIMIZATION PROBLEM!"
@ninocraft1 Жыл бұрын
i bet that would work though xD
@f-149 Жыл бұрын
@@ninocraft1it would work, as long as the game doesnt lag
@lemon_maho Жыл бұрын
Vsync be like
@rea9lizer Жыл бұрын
that fucking 2-space Whitesmiths indentation is the icing on the cake
@facundogoiriz7323 Жыл бұрын
@@ninocraft1 I think the funny thing is that there is no sense to check the fps rate with an if
@MizManFryingP Жыл бұрын
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.
@thefoxguy Жыл бұрын
Thanks for the tip if I ever have headaches doing that. LOL.
@haniyasu8236 Жыл бұрын
so the perpetrator of the war-crime wasn't the programmer, but the web-engine designer
@falquicao8331 Жыл бұрын
@@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.
@rogo7330 Жыл бұрын
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.
@firstnamelastname-yu2td Жыл бұрын
@@rogo7330 Unless you're playing a shitty browser game, no.
@CkW38 Жыл бұрын
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
@Epsicronics Жыл бұрын
That led has to blink VERY precisely, has to sync up to a gps satellite yknow?
@Aneugene Жыл бұрын
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.
@Epsicronics Жыл бұрын
@Aneugene to be fair, i have seen people do that so the professor's shocked face is probably justified lol
@Aneugene Жыл бұрын
@@Epsicronics that was class task for 15 minutes so it was pretty hard to manually type ~700 lines of code in that time
@Epsicronics Жыл бұрын
@@Aneugene Hasn't stopped people from trying lol
@saurabhjadhav7656 Жыл бұрын
1:10 I'm retiring from programming.
@TheWorldWarrior Жыл бұрын
what about the else if one jesus lmao the amount of ))))))))))))))))))))))))))))))))))))))))
@Sucellusification Жыл бұрын
What about 1:29
@simotasca Жыл бұрын
at the end of time there will be no more duality
@soundonly7392 Жыл бұрын
the alpha and the omega
@botanich Жыл бұрын
is your statement true or false?
@TypeScriptTV Жыл бұрын
1:05 it's amusing how every Scratch application is seen as a crime. 😅
@BrainiacManiac142 Жыл бұрын
I think its more about how the variables are emojis.
@asddsaasdfg2846 Жыл бұрын
@@BrainiacManiac142 right
@TheNewton Жыл бұрын
@@BrainiacManiac142 didn't even notice that, impossible to see in low quality mobile
@gmdrandom6287 Жыл бұрын
@@BrainiacManiac142 should’ve included swift
@saurabhjadhav7656 Жыл бұрын
Every middle schooler-I mean scratch programmer clinching their teeth...
@hekanymous Жыл бұрын
1:20 made me lose it, if only it were that easy.
@Mikelica69 Жыл бұрын
💀
@Mikelica69 Жыл бұрын
Infinite fps glitch
@meinukey Жыл бұрын
What? I thought the joke was the bad indentation.
@agentnull5242 Жыл бұрын
The code basically says if the FPS variable doesn’t equal sixty, set it to sixty, instead of actually optimising the code.
@meinukey Жыл бұрын
@@agentnull5242 Wow, mind blown.
@SuperDav1995 Жыл бұрын
Yandev's entire coding expertise condensed into one video.
@shred1894 Жыл бұрын
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.
@SuperDav1995 Жыл бұрын
@@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.
@Mercurie. Жыл бұрын
Nah because he wouldn't use the switch statement
@viktor8986z7o Жыл бұрын
@@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.
@shred1894 Жыл бұрын
@@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.
@MrSaemichlaus Жыл бұрын
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.
@4.0.4 Жыл бұрын
As someone who was afflicted by CSS, translateZ(0.001px) sounds normal, like the sort of thing which somehow fixes a browser rendering bug.
@JordaanM Жыл бұрын
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.
@finite-void Жыл бұрын
Real problem I saw was that multiple units were used for transformations: 'em', 'no units', 'px'. WHY!?
@crypticlol Жыл бұрын
The real problem is using pixel values bellow 1 Like, how it's something smaller than a pixel?
@kevin0xf681 Жыл бұрын
@@crypticlol Internally, css uses floats and pixels just a unit. Having the z translation greater than 0 point whatnot forces hardware acceleration
@crypticlol Жыл бұрын
@@kevin0xf681 Interesting
@johnparrot Жыл бұрын
1:20 the user will never find out 🤭
@asddsaasdfg2846 Жыл бұрын
At least the ‘fps’ var is stable😂
@wayrentmusic Жыл бұрын
0:40 P.S. Translation: Secrets of Python: 59 recomendations for writing the most effective code by Yandex
@EHoT_YT11 ай бұрын
Man, it's all Russians, we're just Pretending
@АлексейПоплев6 ай бұрын
60-й совет идет по подписке Яндекс +?
@johnyguacamole2878 Жыл бұрын
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.
@WackoMcGoose Жыл бұрын
"Welcome to Sonic Team! We make games, I think!"
@ofcdune Жыл бұрын
Ah yes, the classic "Volkswagen Method", genius
@drakondra2 ай бұрын
1:10 The greatest example of dictatorship
@megaslovak1 Жыл бұрын
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
@arteshki5779 Жыл бұрын
Shouldnt let them know where it came from Jano....
@oxycodin2253 Жыл бұрын
These will never get old
@tipdub Жыл бұрын
lol so good. this incredibles soundtrack never gets old, lol.
@TheBoxyBear Жыл бұрын
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.
@realgoatzy11 күн бұрын
i would want to see it in better quality so bad, have you still got it?
@specialc Жыл бұрын
The regex at 1:00 is so beautiful it brought tears to my eyes! It's truly a work of art.
@official-obama Жыл бұрын
yeah, it really tore your eyes
@chrisalex8225 күн бұрын
You know, sometimes you get to a point where you arent scared anymore, but just fascinated
@pixl237 Жыл бұрын
True = false... Masterpiece, a work of art !
@dumpsockpuppet5619 Жыл бұрын
What about .isFalse(true)
@Strike_Raid Жыл бұрын
@@dumpsockpuppet5619 True! Oh, I mean false.
@ВениаминВидантов Жыл бұрын
thats how universe will end
@TheBypasser4 күн бұрын
@@dumpsockpuppet5619 The kid didn't know of Assert.Fail(). Or probably planned on some way to disable (some of) the asserts, and left this as a placeholder. Not clean, not shiny - but still a way to go.
@momparty Жыл бұрын
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.
@Janingham Жыл бұрын
I've started to learn programming to understand these shenanigans
@thomaskaldahl196 Жыл бұрын
ok but the breakpoint on every line hits hard tho
@L.E.I.F. Жыл бұрын
Disclaimer: Code reviewers may have been harmed during this video.
@RealEpikCartfrenYT Жыл бұрын
as someone who knows nothing about programming and has even failed the course at my university, I absolutely agree
@patrykK1028 Жыл бұрын
1:31 python programmers using another language
@camslam8245 Жыл бұрын
The music is the best part. Like we've all seen things like this, but never with that music. Love it.
@dimi5862 Жыл бұрын
My guy really wrote all the variables in katakana
@NyanCoder11 ай бұрын
Not entirely 数 - kanji ん - hiragana
@1nwb-4dnws26 күн бұрын
There's a lang typed in kana for that, only missing kanji since kanji lingo are obscure
@santanukumardas72726 ай бұрын
1:00 that regex gonna filter out an atom.
@thegate8985 Жыл бұрын
0:15 well, translateZ(0) enables the GPU in CSS, it makes the 3D transform less blurry
@asddsaasdfg2846 Жыл бұрын
Bro he included the ‘px’ suffix when the input was integer
@thegate8985 Жыл бұрын
@@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
@asddsaasdfg2846 Жыл бұрын
@@thegate8985 It might be an old exploit to get around a problem tho because that language didn’t seem familiar
@thegate8985 Жыл бұрын
@@asddsaasdfg2846 yea, there are some direct properties for that, but still, I wanted to guess what that person tried to do with that
@purplebokso Жыл бұрын
@@thegate8985 To be silly, no way exception than it.
@pedramhashemi5019 Жыл бұрын
that regex one gave me a heart attack
@tiptoetopia8449 Жыл бұрын
love the incredibles music makes it so much funnier
@maxwhite4732 Жыл бұрын
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.
@Ataraxia0 Жыл бұрын
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
@acobster Жыл бұрын
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
@pavelperina7629 Жыл бұрын
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
@ericfisher4736 Жыл бұрын
A switch statement with fewer than 20 cases is considered by many to be a dull affair.
@mastermati773 Жыл бұрын
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 Жыл бұрын
1:21 is obviously a joke
@SyedAshrafulla Жыл бұрын
0:05 you're playing a real shady lawyer with that response.
@_JoeVer Жыл бұрын
what about 0:00?
@RealRushinRussian Жыл бұрын
@@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.
@b14ckj4ck Жыл бұрын
@@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.
@CottidaeSEA Жыл бұрын
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.
@notuxnobux Жыл бұрын
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.
@salmon4402 Жыл бұрын
True, but in that case you should throw an error properly instead of making a purposely failed assertion.
@sprytnychomik Жыл бұрын
@@salmon4402 Change to 'release' build and assertion disappears (at least it should). Throw does not.
@salmon4402 Жыл бұрын
@@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
@mostm8589 Жыл бұрын
@@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.
@sprytnychomik Жыл бұрын
@@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)?
@supergamezonline2905 Жыл бұрын
1:20 this is more to a meme than to a crime lol
@LinkEX Жыл бұрын
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.)
@key_bounce Жыл бұрын
0:30 That looks like it was for the obfuscated C contest, where the look of the code is part of the score.
@LeeChorch Жыл бұрын
my senior's comment on my PR: "can you add some documentation for these?" me: 0:50 that's an absolute cheat code
@TheNewton Жыл бұрын
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
@nayber2352 Жыл бұрын
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
@SuperGamingAli Жыл бұрын
Where is Yandere Simulator’s code?
@F1reNation7 ай бұрын
And all of undertales code
@bajojajo7946 Жыл бұрын
1:44 yanderedev be like
@heck_n_degenerate940 Жыл бұрын
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.
@Lemon_Inspector Жыл бұрын
You've made us all a horrible disservice.
@heck_n_degenerate940 Жыл бұрын
@@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?
@segfaultthis Жыл бұрын
Bruh, Python is not even compiled
@intelchip_x86 Жыл бұрын
@@segfaultthis python is compiled into bytecode, then interpreted by the CPython interpreter
@MrCmon11310 ай бұрын
Didn't even know that compilers work with Google docs files.
@christiaanbruin49899 ай бұрын
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.
@sandros94 Жыл бұрын
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)
@sk-sm9sh Жыл бұрын
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.
@moravianlion31087 ай бұрын
"True = False" is like the newest Nolan's movie plot
@gurgen5165 Жыл бұрын
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.
@williamdrum989929 күн бұрын
Lmao
@jondoe5849 ай бұрын
1:20 "you can't miss when there's only one option"
@h_oom4114 Жыл бұрын
it really shows how much of an amateur I am cause I only understood like half of these
@laszlokenyo316810 ай бұрын
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
@Quadragintillion Жыл бұрын
our dev team is currently working tirelessly to fix this problem, thanks! :D
@noterobrine99213 ай бұрын
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."
@dreamhollow Жыл бұрын
I have never programmed like this and I am terrified by people who do.
@chrisalex8225 күн бұрын
The thumbnail.pztrified me
@braxbro6674 Жыл бұрын
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.
@abyssaldision5134 Жыл бұрын
Well maybe it was C code.
@ornelas_dev Жыл бұрын
'true = false' is truly one of the lines of code of all time
@ohgodnononowaitwaitwait Жыл бұрын
This is making me feel psychological and physical pain
@stiperunac2272 Жыл бұрын
1:50 Ah yes, the Xi++
@Warpgatez Жыл бұрын
I 100% thought this was about programming AI to commit war crimes in a video game (the unreal engine thumbnail)
@Dom-zy1qy Жыл бұрын
0:35 that is the work of a person who just simply cannot be bothered.
@viinisaari Жыл бұрын
That is literally the worst offense in this whole video.
@chimera5947 Жыл бұрын
I thought this video was going to be about simulating war crimes with code...
@axciom Жыл бұрын
It did. Did you not watch it?
@godnyx117 Жыл бұрын
1:05 I love how the music intensifies on that part! Truly the biggest war crime out of all!
@cryoq1 Жыл бұрын
0:40 , ive seen a friend new to programming do this. It hurted me physically and mentally
@kasiphia Жыл бұрын
You saying "hurted" hurt me significantly.
@Takyodor2 Жыл бұрын
@@kasiphia hurted*
@kasiphia Жыл бұрын
@@Takyodor2 "The past tense of 'hurt' is 'hurt'. It is considered poor English to say “hurted”."
@Takyodor2 Жыл бұрын
@@kasiphia I know, I just thought it was funny (the part where he hurted you significantly with incorrectly grammaring).
@davidhardy30743 ай бұрын
Oh god it makes me feel so much better as an enthusiast dev. The music is amazing lmao.
@darknesspretends991 Жыл бұрын
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 Жыл бұрын
whats the actually correct way to do that?
@jonstewart5525 Жыл бұрын
@@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.
@Maxime-bz2oe Жыл бұрын
@@jonstewart5525 Switch statement is optimised to O(1) in some languages (gcc compiler in C definitely does this for example)
@Knirin Жыл бұрын
@@OniKrisNeptune Passing apparently random function pointers around works. I have seen people argue that with how OOP is defined C is an OOP Language.
@warcinm3210 Жыл бұрын
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.
@pistondev22045 ай бұрын
I completely lost it when it was 'true' = 'false' 😂😂
@brightblackhole2442 Жыл бұрын
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)
@TommyLikeTom11 ай бұрын
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
@humanrightsadvocate Жыл бұрын
I thought it was about war crimes and how to streamline your atrocities in times of war.
@MaxwellCatAlphonk Жыл бұрын
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
@sumbuddy4088 Жыл бұрын
0:10 POV: forgot a semicolon
@turanbirligi696910 ай бұрын
Am i the only one making a whole game in just one file without creating different class tabs or etc. The whole game is just a couple hundred lines of code
@cementsandwich Жыл бұрын
Oh shit, this is just like a video i made last month, congrats brother we shall harvest these views together 🤝
@cementsandwich Жыл бұрын
Screw it, this inspired me to make a part 2
@else1f Жыл бұрын
oh shit, that's just like a video i made 6 months ago.
@cementsandwich Жыл бұрын
@elseif damn lmao? I have a hoard of like 300 of these type of screenshots if you're interested
@IsaMorphic Жыл бұрын
Oh shit, is formula: "screenshots with dramatic music" really original enough for this thread to exist lol? (vid is still funny tho :D)
@GurenDonOfficial2 ай бұрын
the number of switch cases is crazy...the indentations on the if else's make my heart hurt bro
@AhmedHan7 ай бұрын
What is the correct way of the first one?
@CertainlySnazzy7 ай бұрын
id make it a map of strings and callables, but theres probably a better way than that
@ChaoooАй бұрын
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.
@TheBypasser4 күн бұрын
@@Chaooo It is clearly not C/C++ though, as what are those cases? Pointers to string constants? It will not even compile, but should it, what would it be, comparing a pointer to some other one? Why, if they are very likely not equal.
@Chaooo4 күн бұрын
@@TheBypasser Yes, I know that is not C nor C++. I would've immediately noticed that it was as I was trained in C++ in a previous job. The first example looks like TypeScript to me. The cases are a string being used as input, so based on the input, a function of the same name will be invoked (hence the empty parentheses after the symbol name, like "chick()"). Is that what you're asking? If the programming language is able to do "reflection", then you wouldn't need this long switch statement. You would just run the string through a list of acceptable inputs and then invoke the function name. For instance, using pseudocode: ``` # Define the class. class CommentHandler CommentHandler.WritePost = {function definition} CommentHandler.ReadPost = {function definition} # Define vars. object myHandler = new CommentHandler string user_input = (user input) array valid_inputs = ["WritePost", "ReadPost"] # Check if "user_input" is valid. if user_input not in valid_inputs: raise InvalidInputException() # Return the result of the class method where the class method chosen is based on the "user_input" variable. class_method reflected_method = myHandler.getMethod(user_input) return myHandler.invoke(reflected_method) ```
@TheBypasser4 күн бұрын
@@Chaooo Just sayin' :P In fact, this is a very common VB/VBS approach as those lack the function pointers. For C/C++ I always use call tables though (and it seems everyone does), especially as usually a code like this is a user command decoder of some sort, and in order to keep those command systems user-friendly the table also gets stuff like a help text and alike.
@MiiDev69 Жыл бұрын
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.
@0xc0ffee_ Жыл бұрын
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 😅
@neijrr Жыл бұрын
0:30 is a coin, you can see it in the code itself
@ardnys35 Жыл бұрын
it's the eye of wisdom!
@Alexey65536 Жыл бұрын
0:15 is an old hack that made browser use GPU instead of CPU for animation purposes.
@asddsaasdfg2846 Жыл бұрын
@@Alexey65536 so you needed to include ‘px’ and ‘em’ suffixes?
@petrlaskevic1948 Жыл бұрын
@@asddsaasdfg2846 em and px are just different CSS units.The translateZ by a small value here is the hack to trigger the gpu acceleration
@plshalpme17311 ай бұрын
1:11 "when time comes, truth will no longer exist" powerful
@DesertRustEarth Жыл бұрын
blame the intern
@Christobanistan Жыл бұрын
Yes. Then slink away. ( ´・・)ノ(._.`)
@MrSpongix2 ай бұрын
0:30 is a piece of art it makes me cry
@dextr-og Жыл бұрын
The 'true = false' thing has me questioning some people's sanity. Hope that's a joke.
@baileyharrison1030 Жыл бұрын
It wouldn’t compile anyway
@keshi5541 Жыл бұрын
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.
@fuzzy-02 Жыл бұрын
This has Factorio level war crimes too.
@TimMattison Жыл бұрын
I didn't get the dijkstra one (please explain!) but otherwise this is one of the scariest videos I've ever watched
@TimMattison Жыл бұрын
@@sodachi9464 you use a debugger? Subscribed
@TimMattison Жыл бұрын
@@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.
@quadroninja2708 Жыл бұрын
@@TimMattison what devs think that? Not using debugger at all is incomprehensible to me
@Abu_Shawarib Жыл бұрын
@@sodachi9464 I though it was a did where someone deleted the function
@shartdiffractor2582 Жыл бұрын
Case and Break example is the best possible way to do it.
@tPlayerioT Жыл бұрын
atleast is not all if statements
@shartdiffractor2582 Жыл бұрын
@@tPlayerioT That's thanks to the fact that Case and Break statements don't actually use any computing power to resolve - as opposed to extremely hungry If statements.
@tPlayerioT Жыл бұрын
@@shartdiffractor2582 😂
@voodoo5191 Жыл бұрын
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 Жыл бұрын
global[fn]()
@Al-Mokadimah Жыл бұрын
I am still learning programming so I was wondering how else can it be done ?
@else1f Жыл бұрын
@@Al-Mokadimah check above
@Al-Mokadimah Жыл бұрын
@@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.
@else1f Жыл бұрын
@@Al-Mokadimah there's no good way to do it in c other than a lookup table
@DrathVader Жыл бұрын
These make me feel better about my programming skills
@amateurprogrammer25 Жыл бұрын
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.
@Hwyadylaw Жыл бұрын
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)]
@mollthecoder Жыл бұрын
@@WhaleIsOnlineSo you admit to the crime!
@mollthecoder Жыл бұрын
@@WhaleIsOnline What do I get for keeping quiet?
@mollthecoder Жыл бұрын
@@WhaleIsOnline I'd like to see you try.
@hacatu Жыл бұрын
@@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
@Pappalardium Жыл бұрын
As someone who doesn't know much about programming, this is still hillarious.
@rkc137 Жыл бұрын
0:39 это многое говорит о нашем обществе...
@pretzneko8 ай бұрын
0:32 all hail the eye of wisdom, compiler of code and nightmares