programming war crimes 2

Поділитися
Вставка
  • Опубліковано 27 гру 2024

КОМЕНТАРІ • 1,2 тис.

  • @mat_max
    @mat_max Рік тому +8390

    I thought this was going to be about coding a program that commits warcrimes

    • @ForTheOmnissiah
      @ForTheOmnissiah Рік тому +976

      C++ Tutorial: How to create malware to gain access to the United States nuclear missile launch systems, Intermediate difficulty

    • @TheNewton
      @TheNewton Рік тому +190

      That's called Excel vba

    • @juansnyders7323
      @juansnyders7323 Рік тому +114

      ever heard of a game called "Rimworld" then :D

    • @deltamico
      @deltamico Рік тому +12

      Exactly

    • @HealthXPotions
      @HealthXPotions Рік тому +8

      tbh same

  • @2OV5
    @2OV5 Рік тому +5051

    Thank you for the programming tips, i will use it for my final year project

    • @Mikelica69
      @Mikelica69 Рік тому +155

      Oh hell nah 💀

    • @mart6792
      @mart6792 Рік тому +176

      People have been judged in Nuremberg for less than that

    • @vasilevasilescu8199
      @vasilevasilescu8199 Рік тому +107

      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
      @CosmiaNebula Рік тому +66

      Oh it will be your *final year* alright!

    • @Onyxle
      @Onyxle Рік тому +2

      The way to get an A on any project

  • @DoodleChaos
    @DoodleChaos 11 місяців тому +413

    true = false

    • @alvydasjokubauskas2587
      @alvydasjokubauskas2587 9 місяців тому +5

      Nope you got it wrong. It was true = false and next line false = true... At least in Boolean world...

    • @GRIMHOOD99
      @GRIMHOOD99 9 місяців тому +1

      well yes but actually no

    • @freakfreak786
      @freakfreak786 7 місяців тому +1

      i freakin lost at this part

    • @nestharus
      @nestharus 6 місяців тому

      When time is 100 the world shall break and ALL SHALL BE FALSE!!!

    • @CapralHarrison
      @CapralHarrison 3 місяці тому +1

      That actually suppose to destroy all the binary logic computing technology is based upon

  • @Gian69
    @Gian69 Рік тому +1015

    1:01 least obscure/complicated regex statement

    • @viceagain7335
      @viceagain7335 Рік тому +20

      Comeon regex isnt THAT bad

    • @nullFoo
      @nullFoo Рік тому +282

      @@viceagain7335 "The plural of regex is regrets" - Alan Turing

    • @viceagain7335
      @viceagain7335 Рік тому +10

      @@nullFoo its turing it Gotta be true

    • @ShimizuSolace
      @ShimizuSolace Рік тому +54

      ​@@nullFoo Holy that is so good. Almost as good as "dreams are just VMs for brains" I saw a week ago.

    • @PySnek
      @PySnek Рік тому +36

      @@ShimizuSolace Dreaming is cleaning the garbage collector

  • @edwin3928ohd
    @edwin3928ohd Рік тому +1430

    This video is literally my first week in my "self learning" of C++

    • @hermes1873
      @hermes1873 Рік тому +11

      I've also decided to start learning C++ the same way! Are you using a course or YT tutorial video?

    • @BenClementt
      @BenClementt Рік тому +67

      Everyone makes horrifying code when they’re trying to learn! it’s the only way to improve. Done the same with rust recently

    • @joshuafountain
      @joshuafountain Рік тому

      ​@@hermes1873 Self learning taught me the best tbh, I just looked through GitHub source codes

    • @hermes1873
      @hermes1873 Рік тому +3

      @@joshuafountain I'll keep that in mind, thanks

    • @leonardodavinci4259
      @leonardodavinci4259 Рік тому

      @@hermes1873 The Cherno is the best source on C++ on UA-cam

  • @aspoopypixel
    @aspoopypixel Рік тому +1465

    I fucking died on the "I SOLVED OUR OPTIMIZATION PROBLEM!"

    • @ninocraft1
      @ninocraft1 Рік тому +36

      i bet that would work though xD

    • @f-149
      @f-149 Рік тому +68

      @@ninocraft1it would work, as long as the game doesnt lag

    • @lemon_maho
      @lemon_maho Рік тому +80

      Vsync be like

    • @rea9lizer
      @rea9lizer Рік тому +11

      that fucking 2-space Whitesmiths indentation is the icing on the cake

    • @facundogoiriz7323
      @facundogoiriz7323 Рік тому +4

      @@ninocraft1 I think the funny thing is that there is no sense to check the fps rate with an if

  • @MizManFryingP
    @MizManFryingP Рік тому +1370

    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
      @thefoxguy Рік тому +117

      Thanks for the tip if I ever have headaches doing that. LOL.

    • @haniyasu8236
      @haniyasu8236 Рік тому +321

      so the perpetrator of the war-crime wasn't the programmer, but the web-engine designer

    • @falquicao8331
      @falquicao8331 Рік тому +71

      ​@@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
      @rogo7330 Рік тому +87

      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
      @firstnamelastname-yu2td Рік тому +17

      ​@@rogo7330 Unless you're playing a shitty browser game, no.

  • @CkW38
    @CkW38 Рік тому +538

    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
      @Epsicronics Рік тому +40

      That led has to blink VERY precisely, has to sync up to a gps satellite yknow?

    • @Aneugene
      @Aneugene Рік тому +68

      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
      @Epsicronics Рік тому +11

      @Aneugene to be fair, i have seen people do that so the professor's shocked face is probably justified lol

    • @Aneugene
      @Aneugene Рік тому +25

      @@Epsicronics that was class task for 15 minutes so it was pretty hard to manually type ~700 lines of code in that time

    • @Epsicronics
      @Epsicronics Рік тому +3

      @@Aneugene Hasn't stopped people from trying lol

  • @hekanymous
    @hekanymous Рік тому +239

    1:20 made me lose it, if only it were that easy.

    • @Mikelica69
      @Mikelica69 Рік тому

      💀

    • @Mikelica69
      @Mikelica69 Рік тому +39

      Infinite fps glitch

    • @meinukey
      @meinukey Рік тому +2

      What? I thought the joke was the bad indentation.

    • @agentnull5242
      @agentnull5242 Рік тому +22

      The code basically says if the FPS variable doesn’t equal sixty, set it to sixty, instead of actually optimising the code.

    • @meinukey
      @meinukey Рік тому

      @@agentnull5242 Wow, mind blown.

  • @4.0.4
    @4.0.4 Рік тому +347

    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
      @JordaanM Рік тому +18

      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
      @finite-void Рік тому +7

      Real problem I saw was that multiple units were used for transformations: 'em', 'no units', 'px'. WHY!?

    • @crypticlol
      @crypticlol Рік тому +1

      The real problem is using pixel values bellow 1
      Like, how it's something smaller than a pixel?

    • @kevin0xf681
      @kevin0xf681 Рік тому +11

      @@crypticlol Internally, css uses floats and pixels just a unit. Having the z translation greater than 0 point whatnot forces hardware acceleration

    • @crypticlol
      @crypticlol Рік тому

      @@kevin0xf681 Interesting

  • @TypeScriptTV
    @TypeScriptTV Рік тому +584

    1:05 it's amusing how every Scratch application is seen as a crime. 😅

    • @BrainiacManiac142
      @BrainiacManiac142 Рік тому +209

      I think its more about how the variables are emojis.

    • @asddsaasdfg2846
      @asddsaasdfg2846 Рік тому +13

      @@BrainiacManiac142 right

    • @TheNewton
      @TheNewton Рік тому +63

      @@BrainiacManiac142 didn't even notice that, impossible to see in low quality mobile

    • @gmdrandom6287
      @gmdrandom6287 Рік тому +8

      @@BrainiacManiac142 should’ve included swift

    • @saurabhjadhav7656
      @saurabhjadhav7656 Рік тому +18

      Every middle schooler-I mean scratch programmer clinching their teeth...

  • @wayrentmusic
    @wayrentmusic Рік тому +63

    0:40
    P.S. Translation:
    Secrets of Python: 59 recomendations for writing the most effective code by Yandex

    • @EHoT_YT
      @EHoT_YT 10 місяців тому

      Man, it's all Russians, we're just Pretending

    • @АлексейПоплев
      @АлексейПоплев 6 місяців тому +11

      60-й совет идет по подписке Яндекс +?

  • @MrSaemichlaus
    @MrSaemichlaus Рік тому +106

    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.

  • @saurabhjadhav7656
    @saurabhjadhav7656 Рік тому +541

    1:10 I'm retiring from programming.

    • @TheWorldWarrior
      @TheWorldWarrior Рік тому +33

      what about the else if one jesus lmao the amount of ))))))))))))))))))))))))))))))))))))))))

    • @Sucellusification
      @Sucellusification Рік тому +40

      What about 1:29

    • @simotasca
      @simotasca Рік тому +27

      at the end of time there will be no more duality

    • @soundonly7392
      @soundonly7392 Рік тому +8

      the alpha and the omega

    • @botanich
      @botanich Рік тому +1

      is your statement true or false?

  • @johnparrot
    @johnparrot Рік тому +112

    1:20 the user will never find out 🤭

  • @tipdub
    @tipdub Рік тому +154

    lol so good. this incredibles soundtrack never gets old, lol.

  • @SuperDav1995
    @SuperDav1995 Рік тому +807

    Yandev's entire coding expertise condensed into one video.

    • @shred1894
      @shred1894 Рік тому +31

      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
      @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.
      @Mercurie. Рік тому +58

      Nah because he wouldn't use the switch statement

    • @viktor8986z7o
      @viktor8986z7o Рік тому +59

      @@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
      @shred1894 Рік тому +7

      @@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.

  • @oxycodin2253
    @oxycodin2253 Рік тому +129

    These will never get old

  • @johnyguacamole2878
    @johnyguacamole2878 Рік тому +217

    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
      @WackoMcGoose Рік тому +13

      "Welcome to Sonic Team! We make games, I think!"

    • @ofcdune
      @ofcdune Рік тому +10

      Ah yes, the classic "Volkswagen Method", genius

  • @TheBoxyBear
    @TheBoxyBear Рік тому +21

    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.

  • @megaslovak1
    @megaslovak1 Рік тому +75

    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
      @arteshki5779 Рік тому +22

      Shouldnt let them know where it came from Jano....

  • @pixl237
    @pixl237 Рік тому +59

    True = false... Masterpiece, a work of art !

  • @drakondra
    @drakondra 2 місяці тому +7

    1:10 The greatest example of dictatorship

  • @specialc
    @specialc Рік тому +19

    The regex at 1:00 is so beautiful it brought tears to my eyes! It's truly a work of art.

  • @Janingham
    @Janingham Рік тому +34

    I've started to learn programming to understand these shenanigans

  • @chrisalex82
    @chrisalex82 5 днів тому +1

    You know, sometimes you get to a point where you arent scared anymore, but just fascinated

  • @momparty
    @momparty Рік тому +24

    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.

  • @RealEpikCartfrenYT
    @RealEpikCartfrenYT Рік тому +86

    as someone who knows nothing about programming and has even failed the course at my university, I absolutely agree

  • @thomaskaldahl196
    @thomaskaldahl196 Рік тому +19

    ok but the breakpoint on every line hits hard tho

  • @thegate8985
    @thegate8985 Рік тому +33

    0:15 well, translateZ(0) enables the GPU in CSS, it makes the 3D transform less blurry

    • @asddsaasdfg2846
      @asddsaasdfg2846 Рік тому +9

      Bro he included the ‘px’ suffix when the input was integer

    • @thegate8985
      @thegate8985 Рік тому +6

      @@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
      @asddsaasdfg2846 Рік тому +3

      @@thegate8985 It might be an old exploit to get around a problem tho because that language didn’t seem familiar

    • @thegate8985
      @thegate8985 Рік тому +7

      @@asddsaasdfg2846 yea, there are some direct properties for that, but still, I wanted to guess what that person tried to do with that

    • @purplebokso
      @purplebokso Рік тому

      @@thegate8985 To be silly, no way exception than it.

  • @pavelperina7629
    @pavelperina7629 Рік тому +8

    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

  • @L.E.I.F.
    @L.E.I.F. Рік тому +36

    Disclaimer: Code reviewers may have been harmed during this video.

  • @dimi5862
    @dimi5862 Рік тому +80

    My guy really wrote all the variables in katakana

    • @NyanCoder
      @NyanCoder 10 місяців тому +4

      Not entirely
      数 - kanji
      ん - hiragana

    • @1nwb-4dnws
      @1nwb-4dnws 6 днів тому

      There's a lang typed in kana for that, only missing kanji since kanji lingo are obscure

  • @camslam8245
    @camslam8245 Рік тому +5

    The music is the best part. Like we've all seen things like this, but never with that music. Love it.

  • @patrykK1028
    @patrykK1028 Рік тому +13

    1:31 python programmers using another language

  • @CottidaeSEA
    @CottidaeSEA Рік тому +9

    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.

  • @Ataraxia0
    @Ataraxia0 Рік тому +12

    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

  • @maxwhite4732
    @maxwhite4732 Рік тому +14

    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.

  • @acobster
    @acobster Рік тому +14

    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

  • @tiptoetopia8449
    @tiptoetopia8449 Рік тому +19

    love the incredibles music makes it so much funnier

  • @pedramhashemi5019
    @pedramhashemi5019 Рік тому +12

    that regex one gave me a heart attack

  • @ericfisher4736
    @ericfisher4736 Рік тому +2

    A switch statement with fewer than 20 cases is considered by many to be a dull affair.

  • @mastermati773
    @mastermati773 Рік тому +52

    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
      @r.t.5767 Рік тому +12

      1:21 is obviously a joke

    • @SyedAshrafulla
      @SyedAshrafulla Рік тому

      0:05 you're playing a real shady lawyer with that response.

    • @_JoeVer
      @_JoeVer Рік тому

      what about 0:00?

    • @RealRushinRussian
      @RealRushinRussian Рік тому +2

      @@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
      @b14ckj4ck Рік тому +1

      @@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.

  • @sandros94
    @sandros94 Рік тому +22

    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
      @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.

  • @brightblackhole2442
    @brightblackhole2442 Рік тому +6

    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)

  • @nayber2352
    @nayber2352 Рік тому +2

    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

  • @TheNewton
    @TheNewton Рік тому +9

    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

  • @christiaanbruin4989
    @christiaanbruin4989 9 місяців тому +1

    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.

  • @key_bounce
    @key_bounce Рік тому +4

    0:30 That looks like it was for the obfuscated C contest, where the look of the code is part of the score.

  • @laszlokenyo3168
    @laszlokenyo3168 9 місяців тому

    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

  • @heck_n_degenerate940
    @heck_n_degenerate940 Рік тому +8

    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
      @Lemon_Inspector Рік тому

      You've made us all a horrible disservice.

    • @heck_n_degenerate940
      @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
      @segfaultthis Рік тому +3

      Bruh, Python is not even compiled

    • @intelchip_x86
      @intelchip_x86 Рік тому +1

      @@segfaultthis python is compiled into bytecode, then interpreted by the CPython interpreter

    • @MrCmon113
      @MrCmon113 10 місяців тому

      Didn't even know that compilers work with Google docs files.

  • @gurgen5165
    @gurgen5165 Рік тому +3

    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.

  • @SuperGamingAli
    @SuperGamingAli Рік тому +23

    Where is Yandere Simulator’s code?

    • @F1reNation
      @F1reNation 7 місяців тому +2

      And all of undertales code

  • @noterobrine9921
    @noterobrine9921 2 місяці тому +1

    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."

  • @notuxnobux
    @notuxnobux Рік тому +75

    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
      @salmon4402 Рік тому +74

      True, but in that case you should throw an error properly instead of making a purposely failed assertion.

    • @sprytnychomik
      @sprytnychomik Рік тому +14

      @@salmon4402 Change to 'release' build and assertion disappears (at least it should). Throw does not.

    • @salmon4402
      @salmon4402 Рік тому +7

      @@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
      @mostm8589 Рік тому +14

      ​@@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
      @sprytnychomik Рік тому +1

      @@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)?

  • @LeeChorch
    @LeeChorch Рік тому +2

    my senior's comment on my PR: "can you add some documentation for these?"
    me: 0:50
    that's an absolute cheat code

  • @Quadragintillion
    @Quadragintillion Рік тому +3

    our dev team is currently working tirelessly to fix this problem, thanks! :D

  • @davidhardy3074
    @davidhardy3074 2 місяці тому

    Oh god it makes me feel so much better as an enthusiast dev. The music is amazing lmao.

  • @h_oom4114
    @h_oom4114 Рік тому +19

    it really shows how much of an amateur I am cause I only understood like half of these

  • @moravianlion3108
    @moravianlion3108 7 місяців тому +1

    "True = False" is like the newest Nolan's movie plot

  • @dreamhollow
    @dreamhollow Рік тому +6

    I have never programmed like this and I am terrified by people who do.

  • @jondoe584
    @jondoe584 8 місяців тому +1

    1:20 "you can't miss when there's only one option"

  • @supergamezonline2905
    @supergamezonline2905 Рік тому +7

    1:20 this is more to a meme than to a crime lol

    • @LinkEX
      @LinkEX Рік тому +1

      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.)

  • @TommyLikeTom
    @TommyLikeTom 10 місяців тому

    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

  • @braxbro6674
    @braxbro6674 Рік тому +4

    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.

  • @godnyx117
    @godnyx117 Рік тому

    1:05 I love how the music intensifies on that part! Truly the biggest war crime out of all!

  • @Warpgatez
    @Warpgatez Рік тому +9

    I 100% thought this was about programming AI to commit war crimes in a video game (the unreal engine thumbnail)

  • @ornelas_dev
    @ornelas_dev Рік тому +1

    'true = false' is truly one of the lines of code of all time

  • @chimera5947
    @chimera5947 Рік тому +9

    I thought this video was going to be about simulating war crimes with code...

    • @axciom
      @axciom Рік тому

      It did. Did you not watch it?

  • @zero-09
    @zero-09 7 місяців тому

    Watched 5 minutes of unskippable ads for 2 minutes of content, worth it.

  • @cryoq1
    @cryoq1 Рік тому +4

    0:40 , ive seen a friend new to programming do this. It hurted me physically and mentally

    • @kasiphia
      @kasiphia Рік тому +5

      You saying "hurted" hurt me significantly.

    • @Takyodor2
      @Takyodor2 Рік тому

      @@kasiphia hurted*

    • @kasiphia
      @kasiphia Рік тому

      @@Takyodor2 "The past tense of 'hurt' is 'hurt'. It is considered poor English to say “hurted”."

    • @Takyodor2
      @Takyodor2 Рік тому

      @@kasiphia I know, I just thought it was funny (the part where he hurted you significantly with incorrectly grammaring).

  • @GurenDonOfficial
    @GurenDonOfficial Місяць тому

    the number of switch cases is crazy...the indentations on the if else's make my heart hurt bro

  • @ohgodnononowaitwaitwait
    @ohgodnononowaitwaitwait Рік тому +11

    This is making me feel psychological and physical pain

  • @backstabba
    @backstabba 11 місяців тому

    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...

  • @bajojajo7946
    @bajojajo7946 Рік тому +7

    1:44 yanderedev be like

  • @Dom-zy1qy
    @Dom-zy1qy Рік тому +2

    0:35 that is the work of a person who just simply cannot be bothered.

    • @viinisaari
      @viinisaari Рік тому

      That is literally the worst offense in this whole video.

  • @darknesspretends991
    @darknesspretends991 Рік тому +13

    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
      @OniKrisNeptune Рік тому +1

      whats the actually correct way to do that?

    • @jonstewart5525
      @jonstewart5525 Рік тому +2

      ⁠@@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
      @Maxime-bz2oe Рік тому +2

      @@jonstewart5525 Switch statement is optimised to O(1) in some languages (gcc compiler in C definitely does this for example)

    • @Knirin
      @Knirin Рік тому +2

      @@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
      @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.

  • @chrisalex82
    @chrisalex82 5 днів тому +1

    The thumbnail.pztrified me

  • @humanrightsadvocate
    @humanrightsadvocate Рік тому +4

    I thought it was about war crimes and how to streamline your atrocities in times of war.

  • @DrathVader
    @DrathVader Рік тому +1

    These make me feel better about my programming skills

  • @amateurprogrammer25
    @amateurprogrammer25 Рік тому +9

    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
      @Hwyadylaw Рік тому +4

      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
      @mollthecoder Рік тому

      ​@@WhaleIsOnlineSo you admit to the crime!

    • @mollthecoder
      @mollthecoder Рік тому

      @@WhaleIsOnline What do I get for keeping quiet?

    • @mollthecoder
      @mollthecoder Рік тому

      @@WhaleIsOnline I'd like to see you try.

    • @hacatu
      @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

  • @santanukumardas7272
    @santanukumardas7272 5 місяців тому +2

    1:00 that regex gonna filter out an atom.

  • @AhmedHan
    @AhmedHan 7 місяців тому +3

    What is the correct way of the first one?

    • @CertainlySnazzy
      @CertainlySnazzy 6 місяців тому

      id make it a map of strings and callables, but theres probably a better way than that

    • @Chaooo
      @Chaooo 24 дні тому

      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.

  • @MiiDev69
    @MiiDev69 Рік тому +1

    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.

  • @cementsandwich
    @cementsandwich Рік тому +19

    Oh shit, this is just like a video i made last month, congrats brother we shall harvest these views together 🤝

    • @cementsandwich
      @cementsandwich Рік тому +4

      Screw it, this inspired me to make a part 2

    • @else1f
      @else1f  Рік тому +8

      oh shit, that's just like a video i made 6 months ago.

    • @cementsandwich
      @cementsandwich Рік тому +4

      @elseif damn lmao? I have a hoard of like 300 of these type of screenshots if you're interested

    • @IsaMorphic
      @IsaMorphic Рік тому +5

      Oh shit, is formula: "screenshots with dramatic music" really original enough for this thread to exist lol? (vid is still funny tho :D)

  • @ngso_dec
    @ngso_dec Рік тому

    that blueprints graph is the most beautiful thing i've ever seen

  • @0xc0ffee_
    @0xc0ffee_ Рік тому +9

    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
      @neijrr Рік тому +4

      0:30 is a coin, you can see it in the code itself

    • @ardnys35
      @ardnys35 Рік тому +3

      it's the eye of wisdom!

    • @Alexey65536
      @Alexey65536 Рік тому +8

      0:15 is an old hack that made browser use GPU instead of CPU for animation purposes.

    • @asddsaasdfg2846
      @asddsaasdfg2846 Рік тому +1

      @@Alexey65536 so you needed to include ‘px’ and ‘em’ suffixes?

    • @petrlaskevic1948
      @petrlaskevic1948 Рік тому +2

      @@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.

  • @sumbuddy4088
    @sumbuddy4088 Рік тому +3

    0:10 POV: forgot a semicolon

  • @MaxwellCatAlphonk
    @MaxwellCatAlphonk Рік тому +1

    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

  • @tevl3551
    @tevl3551 Рік тому +3

    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?

    • @codesymphony
      @codesymphony Рік тому +2

      literally just
      const functions = { func1, func2, func3,... }
      functions[functionName]()

  • @plshalpme173
    @plshalpme173 11 місяців тому

    1:11 "when time comes, truth will no longer exist"
    powerful

  • @TimMattison
    @TimMattison Рік тому +5

    I didn't get the dijkstra one (please explain!) but otherwise this is one of the scariest videos I've ever watched

    • @TimMattison
      @TimMattison Рік тому +1

      @@sodachi9464 you use a debugger? Subscribed

    • @TimMattison
      @TimMattison Рік тому +2

      @@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
      @quadroninja2708 Рік тому +2

      @@TimMattison what devs think that? Not using debugger at all is incomprehensible to me

    • @Abu_Shawarib
      @Abu_Shawarib Рік тому

      ​@@sodachi9464 I though it was a did where someone deleted the function

  • @Pappalardium
    @Pappalardium 11 місяців тому +1

    As someone who doesn't know much about programming, this is still hillarious.

  • @dextr-og
    @dextr-og Рік тому +6

    The 'true = false' thing has me questioning some people's sanity. Hope that's a joke.

    • @baileyharrison1030
      @baileyharrison1030 Рік тому

      It wouldn’t compile anyway

    • @keshi5541
      @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.

  • @starpawsy
    @starpawsy 2 місяці тому

    That regex is awesome. The power of Unix is such that taht will probably work and do exactly what he wanted it to.

  • @DesertRustEarth
    @DesertRustEarth Рік тому +3

    blame the intern

  • @TosmatoSoup
    @TosmatoSoup 10 місяців тому

    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

  • @voodoo5191
    @voodoo5191 Рік тому +4

    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
      @else1f  Рік тому +1

      global[fn]()

    • @Al-Mokadimah
      @Al-Mokadimah Рік тому +1

      I am still learning programming so I was wondering how else can it be done ?

    • @else1f
      @else1f  Рік тому

      @@Al-Mokadimah check above

    • @Al-Mokadimah
      @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
      @else1f  Рік тому +1

      @@Al-Mokadimah there's no good way to do it in c other than a lookup table

  • @CinemaSagas
    @CinemaSagas 11 місяців тому

    This is why in the past 40 years of hardware improvements, nothing really seems faster or better really.