I used to write my first programs like this. It was console RPG with like 10 levels, enemies and stuff. Then I used functions... then classes... well, it was progressive learning.
0:46 been there, then I just wrote other function which will return/end when it needs to stop checking further (no nesting, just one after other) & return at each failure case.
Boludo, últimamente me aparece en el inicio de RU-vid, standups que salieron en Bendita de youtubers que sigo hace banda. Ya este es el tercero junto a Luquita Rodríguez y Rober Galati
@@walidbinsiddik is this not just the same as if (result >= 0) return true; else return false; I understand that it could just have been: return result>=0; but the ternary return statement doesn’t seem like much of a “programming war crime”
I once wrote a function that takes 11 parameters which simply initializes an object whose constructor takes all 11 parameters in the same order. I'm happy to say that I've reduced the parameter count to only 9 after a few hours of intense self-reflection.
The real criminal is the object that takes ordered parameters with that many items and not a Hash. If you're consciously aliasing something, at least you're paying some consideration to design.
I'm ashamed to say I've done this. Can't remember the exact details but I think I was trying to round a number to some amount of significant digits. Was easier to just use the standard library function for displaying a number as a rounded string, and convert it back to a number.
I really like these videos, however I'd like to point out an issue in editing: if you have a very long strip of text that carries over multiple lines, and you do a left to right pan on it, you have to replay the video a few times to actually read what it says, because after you panned to the right for the first line, the beginning of the second goes out of frame, and so on
in a exam regarding C I was supposed to reverse a string but because I had slept on C for the entire semester I didn't know jack about reversing characters in a string so I just logged my own characters in reverse
i just love this music it's perfectly suited for cursed programming, as monstruosities hidden deep inside the code, waiting to be discovered by the innocent viewer, who then begins to realize just how horrible this is. All the software in the world incorporates terrible code somewhere, and if it were to break, the consequences would be dramatic, considering how dependent to sofware our society has become. As the video progresses, it dawns on the viewer that we were the monsters all along.
0:18 is just why, like this is 100% made by someone that started programming in the last two days, you can easily make this into a simple command, just why
Fun part is, that I've used the "fake loading bar" myself, but in an Arduino project (so it looks cool, I guess) Also to give sensors time to "level out" their reading before taking the mean from 10 values :P
I used to program in flutter and had a class that managed the general sizes of anything you draw in the screen, from text to a box so it maintains a similar look while being dynamic and adaptative between phone screen sizes, and also added a font size option. Because of how it worked, I just made it so it changed the file and reloaded the app, but it did it all so quick that my pals thought it was broken and it crashed, because of how immediate it was. I had to add an entire "restarting" text bar with a second or so of delay so people knew it wasn't broken
Reminds me of the time I made a class called "VolatileVarStorage" The point being that there where some variables and class objects in java that I wanted all child threads to report back to / work on, and I could not get it all sorted out neatly, so I just gave each one the "VolatileVarStorge".
I remember when I was starting out, I didn't know that I could access an item from an array with an index. I was using a vector object in python which had a __repr__. I would convert the object to a string, and then "sanitize" the string by replacing the characters I didn't want such as angle brackets, parenthesis. and then I looped through the string until I hit a comma
@@pacorodriguez734 Did you mean "violent"? If yes, I agree it sounds a bit odd, but for me it's rather too formal or implying it's too hard for that purpose. I wouldn't use "desafío" here, but perhaps some teacher would, or they just speak a Spanish dialect I'm not familiar with where that's the normal way to phrase it. I've seen desafío being used in similar situations, but can't remember where. It didn't occur to me it could be another language lol.
@@PlayerClarinet actually no! because every syscall switches a context so you end up with somewhat lower cpu usage 😁 but still, equally dreadful code haha
Sometimes strange code, it's just bypassing compiler errors, libraries, frameworks, engines, and so on. When the shit code is layered on the shit code, but it doesn't work any other way. And so, yes, it is necessary that the programmer understands mathematics a little, although many programmers do not understand anything about math. For example, I look at old programming magazines, more precisely, advice to programmers in magazines for the 80s, 90s.
Well...if you like it then Im going to explain to you 2 of these jokes XD. Let's freeze a program! while(1 == 1){"Just wait for it"}; This is a loop that tests WHILE 1 is equal to 1 then "do nothing", and then tests again if 1 is still 1 then ask again...and again...and again...so once the program hits this loop...it will literally do nothing forever! Let's hardcode a calculator! Why not? function sum(a,b){ if(a == 1 && b == 0)return 1; if(a == 1 && b == 1)return 2; if(a == 1 && b == 2)return 3; //Remember to include all the numbers to infinity! } If you do this then you literally need to hardcore evey sum of two numbers...every single one of them! XD function sum(a,b)return a+b; You just need a line...that's the joke! XD Hope you enjoyed it. :)
For some reason it's joining a table with itself and joining on id. Just... what? Then the where clause actually limits it to a certain id, but why not just a simple select?
I think the def Min(a,b): return min(a,b) Is my favourite, because it tells such a good story. Clearly the programmer wrote the code using Min() and instead of replacing each time he wrote it just thought “aaaah fuck it.”
I spent way to long getting a dynamic wallpaper hacked together on my phone As soon as Apple changes how math operations withing shortcuts handle the time it will implode
Usually, the code in these videos are so obscure or complicated that you sometimes can't really tell if it does its job correctly. 0:23 is the most pointless piece of code i've seen tho, line 3 is guaranteed going to cause an error
@@Ristyo well then bad assumption. You're clearly not operating on the same level as the genius who wrote that code. Granted, I'm not on that level either, but there is no doubt in my mind that the way he joins the table with itself so that the data is duplicated within the row has some brilliant reasoning behind it that our puny brains just can't understand.