Programming War Crimes | Prime Reacts
345,257
Published 2023-04-02
twitch.tv/ThePrimeagen
Original: • programming war crimes 1
Author: youtube.com/@else1f
MY MAIN YT CHANNEL: Has well edited engineering videos
youtube.com/ThePrimeagen
Discord
discord.gg/ThePrimeagen
All Comments (21)
-
I used to be really frustrated with how difficult to understand academic papers are, but after gaining enough knowledge, I'm now a little more sympathetic - it's really easy to tersely express ideas with complex language, simplifying them requires a lot more effort and is almost always more verbose.
-
One from my brother: Code purpose: Every time list is changed, sort list. Problem: sorting list counts as a list change, producing infinite recursion. Solution: catch exception when hitting max recursion depth, assume list is sorted at that point, and continue from where you left off. As he says: "if it works, it works!" [He did fix it the next day when he worked out the proper way to do it.]
-
5:31 For those wondering, this is Minecraft enchanting table language (aka Standard Galactic alphabet), which is actually not a language but just a font that looks all funky
-
Glad you enjoyed this 🤣. There are so many versions of this now and I'm so glad you picked mine! And sorry about the video quality 😅
-
7:13 When the developer says that they code 1000 lines of code a day
-
1:34 I actually did that recently. The stack trace sometimes contained personally identifiable information, so I caught and rethrew the error to get rid of it in our logs.
-
8:47" if(true == false)" that is some interesting fucking code there.
-
the funniest thing in java to me is to catch an IOException, just to re-throw an UncheckedIoException
-
I've seen this one java class that had a 6,500 line method with 5 layers of inheritance. Stuck right in the middle of the method were these two massive nested if blocks where they both were ~450 lines of if, else if, else crap. Best part was the second of the two if blocks was a copy and paste of the first with one comment saying "don't delete this because for some reason the code won't work without it," and you know what that person was right!
-
Prime's reactions are the funniest
-
I literally had seen code from a colleague with constants like this: int OneSecondWaitTimeout = 1; int TwoSecondWaitTimeout = 2; int FiveThousandMillisecondsTimeout = 5000; Not a joke, it exists and everytime I review code from this guy, I die inside.
-
I've led a priviledged life. The C code I work with most days is bad, but never this bad. Thank you kernel devs.
-
Catching and then rethrowing immediately is useful when you need a debugger trap because breaking on exception sometimes destroys the callstack legibility, I'm looking at you javascript. And then you forget it and push it to production.
-
6:38 Experts, please explain to me the difference between a Git rainforest and a primitive Git jungle. What are the most toxic bugs that can be found in there?
-
can't believe this has not more views, it has to be one of your best videos
-
This is one of your best videos! Loved it 😂❤!
-
I love that “Bustin’” is on your watch list 😂
-
-
About sentered code - it is actually a thing that was popular back in the days where ide was not common an people programmed in simple text editors. Ive seen that myself but aside from how it looks it was pretty comfortable to read and there was no errors.
-
One that always gets me: ``` if condition return true else return false ``` Or one where items were deleted from a collection in a set of nested loops and checks, e.g. ``` while true { for index in range { if (range[index] == itemToDelete) { range = range[0..index-1] + range[index..range.size] found = true } } if found break } ``` There are so many better options one can choose. One, assuming no need to preserve order or immutability is to reverse the iteration order and swap the found item with the last [unmatched] index and then just trim the collection to the new size.