What an idiot, he could’ve used a hash-map
He should at least delete the odd numbers and just use a default return.
absolutely not. that would make a little sense
VeRbOsE cOdE iS mOaR rEaDaBlE
(yes, I know it can be for sure, but... not like this monstrosity in OP)
She was a float x,j,jx,xx girl, he was a LocalCompServiceAbstractFactoryBeanInjectorProviderFactoryFacade boy.
thanks Sun
On small number, it would be smaller? It sure how compiler handles that but odd numbers would be compared to all even numbers before going to default, whereas in this implementation a 3 or 5 would only do a few comparisons.
So depends on what kind of numbers you’re expecting
I bet he typed all this shit out too. Learn to use vim macros guys come on.
qnykjpCAAj^CAA
1000000@n
Just saved you literal weeks of time with my superior vim interlect 😎
Are you single stud?
I’m about to send you to a permanent hash-nap
Need that O(1) complexity
I just had a flashback of my colleagues java code where every function took a hashmap as an argument and modified it.
global.is_number_even[0] = 1; // Number 0 is even
global.is_number_even[1] = 0; // Number 1 is not even
global.is_number_even[2] = 1; // Number 2 is even
global.is_number_even[3] = 0; // Number 3 is not even
Anyone see the latest Code Jesus video benchmarking his game code?
It got 19 fps from rendering a single object.
Didn’t he say something like it was redrawing the same sprite 80,000 times?
Absolute mad lad
this was on an 800x100 sprite for reference, so redrawing the entire sprite for every single pixel in the sprite.
Carmack watch out we got a visionary on our hands
That one is a big miss tho. Their method is a simple mask vs a naive ray tracing sort of thing. Sure the code is still dog shit, but the two are not doing the same thing. The ray tracing will make the light stop at small obstacles while their method will not do that. The idea of just doing a naive ray tracing thing is IMO fine if written properly and performance probably will be fine once the game is built. The proper methods to do this have trade offs and it makes sense to have a really high expensive light if it's like the main player light and you know the scene will only ever have one such expensive light.
There are so many huge huge problems with the code it's kind of sad they focus on something debatable and get it wrong.
Also it's kind of ridiculous Gamemaker still does not have somthing as basic as a 2D lighting system.
Meanwhile his followers are like : yeah but you dont get it, you prolly never touched GMS. And hes also an ex blizzard dev and worked with GMS for 10 years so hes kinda the expert. For loops? No no no see he made this with the ARG in mind so its actually smart
“I made my code shitty and unworkable on purpose, it’s an ARG of course”
“QA are also developers and I was a QA at Blizzard so I am a developer with 20 years of experience”
Oh I get it the ARG is to fix the code.
i've used gms. almost everyone who uses it writes bad code like this because gml is a shitty and inconstant language
New to this, what are ARG and GMS?
there is legitimately people who are making videos defending his code claiming to be software engineers. No joke, this dude whipped out some nonsense copy pasted C code into Notepad on Windows as proof of his skill, and opened another OSS project in VS Code to say that arrays exist so using a global array of ints is valid lmao. Thats one thing, but there were a ton of people in the comments who were fooled by it.
gamemaker is how I got into this when I was a wee lad, funny how it’s coming back to haunt me
In all fairness Game Maker did not have boolean data type back in 2018.
Really? That sound like a very basic feature to miss.
I mean c didn't have it until c99 and you need to include a header for it
I have no fucking idea about programming, yet i know that is ineficient as hell
I feel like everyone was all about Thor for a while, and then all of a sudden people turned on him quick
well, its honestly kinda on his behavior. This is gonna be long, but its been months of development so hard to easily summarise.
He was really beloved due to his really popular shorts explaining coding concepts and certain other difficult concepts with ms paint.
But then 2 big incidents happened with a ton of small things inbetween, where he had some absolutely terrible behavior, and then doubled and tripled down on his behavior, when everyone kept telling him he was wrong.
The first incident, was about him getting his team killed in a wow raid, on the hardcore server, that sucks, it wastes a lot of peoples hours, but it happens, and people were ready to move on if he simply said sorry and moved on. instead he kept blaming others, kept saying he could not have done anything to save the team (he could have), and kept pushing the idea that he was a hardcore pro player, when all the actual pro's reviewed the footage and said his gameplay was bad, and some very basic skill usage would have allowed his party to flee and survive the incident.
small incident got blown up into days and days of drama due to his behavior, from that, he got kicked from the guild, people went through his old streams and found other similar behaviors in wow and in other games, him abusing his popularity to get people to mass spawn kill players that pissed him off in some way, shit like that. A lot came out, because he pissed off people so much with his behavior and knowitall attitude.
A few months later, it all happens again, but this time, with a more serious topic, game preservation, the Stop killing games movement and petition gets formed and pretty much everyone covers it in a positive or neutral light, in comes Thor with a full on negative attack on it, both on the movement and on the person running it, Ross. he calls him a ton of crap, says shit like "he is a used car salesman", and "eat my entire ass" to Ross. And once again uses his popularity, to heavily halt the movement, because "he knows his shit" so if he says its bad, then its gotta be bad. he also had one of the most viewed vids on the topic, so that certainly did not help.
Eventually Ross does a video debunking his claims, due to the petition almost certinly failing, needing still 50% more votes with 11 months used up, only 1 more month left in the petition. This actually gets covered by a ton of big youtubers, from all across youtube and twitch, who point out how bad Thors points were. and how horrible he was towards Ross. This goes crazy, and ontop of all the past drama, really ruins Thors reputation, not only showing again that he is a dick, but really showing how little he actually knows about programming and development in general.
this again leads people into looking back into old streams and a lot more bad shit comes out.
Just to mention a few of the smaller things that came out over both of these 2 bigger dramas.
people found solid proof that he cheats in puzzle games to make himself look smarter, including doing this multiple times in outer wilds and animal well, including the famous moment where he solves a puzzle in a few minutes, that took the whole games community multiple days to solve together. Without even all the pieces of the puzzle.
he has been working on an undertale clone for about 7 years, being sold as early access, which he supposedly constantly works on and keeps promising updates as he asks people to buy the game, but when reviewing a ton of footage, people noticed, he would spend hours on his coding streams, writing maybe 2-3 lines of code, and then constantly doing other shit. Making progress on the game, both on stream and off stream, non existent. With updates being rare and miniscule, with no real new content in years. People then started to dig into the code itself, noticing some really horrible practices, which ofc, Thor got very defensive over once again, claiming the code to actually be good.
His voice was spotted to be faked, bass boosted and adjusted to sound a lot deeper then it actually is he claims its a second puberty, but fairly recent clips came out of him at events where he sounds much squeakier, so its clear that he has filters on.
him working at blizzard for many years as a dev seems to basically be BS, he worked as a QA tester, not an actual developer, those jobs ofc are very different, but he would constantly bring up working as a dev there. ofc, not to mention that he got the job from his father, which by his own admission of being a "first second generation blizzard employee", basically means he was a nepo baby who was a QA tester, which again, completely crushes his persona of this big blizzard dev.
one more for the coding bucket, he has claimed to have won 3 black badges at DEFCON and years of security experience in working at... power plants. But well, turns out there is no proof at all about that security experience, apart from his own stories, and as for the black badges, technically he got them yes, but, it seems to not be because he is such a smart cookie, but rather because, his popularity allowed him to gather large teams of strong professionals that he would "manage". Where he basically did fuck all. At least according to some of his old team members from those DEFCONs.
That's still not even all of it, but id be sitting hear all day writing this up.
So yeah its a lot, but the TLDR is:
The internet didnt just turn around one day and say "hey, lets hate on this guy now". Its been months of events being discovered due to 2 big incidents happening that tanked his credentials, and had people look deeper into his life and streams. Which then showed that his whole persona and skill set were fake and he was a pretty horrible person at heart.
I know it is probably the most miniscule of the bunch but I remember before the drama surrounding him, he showed up on various irl streams/videos for other people and his voice was relatively the same. Nothing that seemed off between studio vs non-studio at least. I know there are significantly older clips with him having a significantly higher voice but it wasn't nearly to that degree.
Granted after round 1 of the SKG drama and the hard-core WoW wipe I stopped keeping up with him if there was new things that surfaced. Just wasn't worth the time.
edit: after watching him cheat at a damn puzzle game, to look smart, like the hardest fucking grifter, I think its honestly not even worth it to highlight any valid points he might have made. Better for anybody else to make those points. Thor can stick it out in his new well earned image of complete incompetence.
It’s the cycle of the internet. Vibes rule all.
Partially true, but also when he stayed in his lane and talked about basic salting for passwords or hashmap collisions in short video format people ate it up and didn't care.
It was when he decided to be an authority on all things tech and never admit that he's wrong about anything whatsoever that people started realizing he never grew out of that guy in your data structures class who tries to do something over the top and complicated and claim that it's the best and anyone who doesn't know how to do it that way is a moron.
I mean, sure, that's annoying, but this still seems like a fucking insane over-reaction for a problem that amounts to "a guy is wrong on the internet."
Oh it for sure is. I think there is a certain amount of joy people get from going 'this guy is wrong and refuses to admit it' and then poking that bear as much as they can because it's funny. It wouldn't be entertaining to folks if he was wrong and said 'yup I'm a novice coder and this could certainly be better written'. Instead he gets mad and bans any dissenters and in turn becomes easy to hate on.
It's also mostly harmless. Like this isn't a political guy or someone who is dealing with heavy topics. He's just a good old fashioned lolcow. It makes it easier for people to get in on the drama.
I mean he did almost kil stop killing games initiative
I don't think so. Refusing to acknowledge you were wrong on several occasions, doubling down and acting condescending towards anyone that points it out, and going out of your way to publicly be a complete dick to towards people that never did anything to you, what do you expect to happen?
Because of undeserved and unexpected popularity, he had to start maintaining a fake image of himself that he never was. The cracks did not take long to show, simple as that. Also said and did some of the dumbest things a person can say or do, doubling down on mistakes, digging his own grave, etc.
Because he misrepresented what his job was for blizzard. And now he’s acting like he never misrepresented it. People don’t like being treated as if they’re stupid, shocker
did himself in, can only be a slanderous hypocrite for so long, could have kept his grifts and smokescreens up if he wasn't so egotistically challenged to everyone he met
Mainly because he isn’t all that he cracked himself up to be
Thats just how being famous on the internet works, the pendulum always swings back.
I seriously doubt the broader community will ever see him favorably ever again.
Yeah probably, and but then people will get bored eventually and a new famous person will be involved in some drama that gets all the ragebait clicks. As long as status is being changed the audience remains entertained.
People just want attention
ngl I never liked him, so it felt a little validating. nothing makes me more annoyed than a person who is constitutionally incapable of taking any amount of criticism or responsibility when they are objectively in the wrong. If dude just came out and said "my bad, I coulda done a little better here..." or "hey, my code sucks, but I just want to express myself and release a game" I would defend him. The bad code isnt the problem, the attitude is tho. Thats said I don't really care enough to engage whatsoever, but I did enjoy watching the code review videos popping up here and there
I actually still like him. He is generally positive, which is good in this space. His take on STG is absolutely terrible but I don't think it is as "evil" as so many make it out to be. He has a financial incentive to go against it (even though it isn't a law yet). It makes sense he would. He just isn't being that honest about it, which is lame.
It’s weird. At least initially he brought a lot of good attention and vibes to the game dev space. “Anyone can make games.” His game jams are the reason I have anything of note on my itch page. He has some industry knowledge that is interesting and helpful.
But oh my god his personality is impossibly grating to me now. I recognize the good like you, but I can’t stay I “still like him” personally. This “I can do no wrong” arrogance, willfully misleading statements like “I’ve been in the industry for 20 years” when that obviously doesn’t refer to him actually making games or touching code in that time frame, and a total lack of honesty and transparency in the progress of his game that a lot of people backed.
Idk, everyone’s flawed and does dumb shit, but overall he does not seem to be a net positive.
yanderedev jump scare
yanderedev knew he was bad at coding and a beginner, this guy claimed to work as a senior developer while actually just working in a QnA
QA*
He was an elite government hacker in case you weren't aware.
Isn't there enough real shit from this guy's code that we don't need to make stuff up?
Yeah, but then people would have to actually look at the code and not have a youtube personality tell them its good code or not XD
I'm a believer of you can always write better code and the best code comes from code review and pair programming.
This actually makes a lot of sense. Let me explain
*breaks out MSPaint
In computer programming, if you are dealing with large numbers, you are doing something wrong. You never want to see a number larger than 256.
*draws 256
So, this might seem tedious, but once I've written 256 lines of code like this, I'm done. My program has a foolproof way of detecting an even number. And if I try to give it a number larger than 256, it will fail (*draws a sad face), which is what I want (*draws a happy face).
bash
npm install is-even
Wrong language champ.
fixed it for you:
else if(number == 2) return true; //this number is even
else if(number == 3) return false; //this number is odd
else if(number == 4) return true; //this number is even
else if(number == 5) return false; //this number is odd
...
Thanks, I was really confused before. This helps me understand. Isn't it weird that odd is the same things as false? Does that make weird false too? This computer stuff is hard.
else if(number == 2) return 1; //this number is even
else if(number == 3) return 0; //this number is odd
else if(number == 4) return 1; //this number is even
else if(number == 5) return 0; //this number is odd
...
fixed it for you
Adding this guy to any programming intern meme is peak 🤣
Random question, is just using mod 2 and checking for 0 an effective is even, still in uni atm so just making sure I'm not stupid.
Yes, that's a fine implementation that works with all arithmetic primitive types. If it's just for an integer type, you can use a bitwise & to read the LSB. The LSB will be 0 for all even numbers and 1 for all odd numbers.
Yeah, I have read that reading the bit is what some languages do under the hood with mod 2 as well.
Clearly fake, Thor hates bools and often uses ints instead to store true/false
Yeah I remember the old good times, I was the colleague who told him that natural numbers set ℕ was finite and he believed it. Brooo, it was just a prank, please stop writing if else statement, there is no end to it! 😭
Inaccurate, based on what I've seen, there aren't enough comments in this to be PirateSoftware code
while(number > 10)
number -= 10;
if(number == 1)
return false;
else if (number == 2)
return true;
else if (number == 3)
return false;
else if(number == 4)
return true;
else if(number == 5)
return false;
else if(number == 6)
return false;
else if(number == 7)
return false;
else if(number == 8)
return false;
else if(number == 9)
return false;
else if(number == 10)
return true;
else
return "Unknown character at index 0: -";
Once worked at a company that determined if excel was installed on someone's machine by looking at if excel.exe was in certain file paths. It looked like this. Check program files. Program files x86, etc.. I was very upset
He must do this on purpose, right? Like he tries to write as inefficiently as possible? This cannot be a real, unironic attempt by an honest person. He has got to be trolling
Is this an actual code snippet of his or just a meme ☠️
As simple as it can get, production level code!!!
Shouldn't those all be 0 and 1 instead of false and true? Based on other code I saw of his.
It's a Boolean at the end of the day. Most languages knows that true is 1 and false is 0. True and False probably just represents their values.
yeah, but piratesoftware doesn't use the words false and true when the numbers 0 and 1 suffice
It's just a generic meme with Pirate Software edited on top , I'd pray for someone soul if they actually go out of their way to make a tailored version 🙏.
I present to you all, the most cursed way I can think to do this that isn't a massive if statement.
isEven(input_integer, 1, False)
public static bool isEven(int int_to_check, int comparison, bool result) {
if(int_to_check == comparison) {
return result
}
else {
isEven(int_to_check, comparison + 1, !result)
}
Give this guy a break, man xd
Everything this guy does is getting annihilated and it's hilarious. I wonder what's next.
I'm newer to programming and seeing this guy get roasted for mistakes I don't even understand is kinda demoralizing. Can we chill?
Don't get discouraged.
First this isn't real code its a very common joke snippet with the guy's streamer image on it.
Second, the reality is that code can always better. You will always find more efficent ways of doing something. You come across a common task at work and have techique drilled into your mind for months. Then one day you'll learn theres a function that does it all for you and faster. Thats growth.
Finally, industry doesn't care about who's the best coder, it cares about results. If you have a developer who writes ok code in a day and a developer who writes immaculate code in 2 days, developer 1 is more desirable. I often have days where I don't code, instead I draw diagrams to explain a process. Then I have to muddle through statements and research how the process is done. Then I code it only to find out someone didn't tell me a key step.
The issue isn't the guy's mistakes. The issue is that the guy talks a big game then makes rookie mistakes. Don't be discouraged.
When coders and vibe coders agree with this being crap
This is obviously the way you should check, far superior. /s ``` bool is_even(int z) { bool b = false; int a = 0; while(true) { a=a+1; if(a==z) { return b; } if(b) { b=false; } else { b=true; } } }
```
Giant array of bools, use the number as an index
Lol
IsEven(Num): If Num >2: Return isEven(num-2) Return num 1=2
return n & 0b01;
They should truncate it to only the final digit of the input. Then this would be a legitimate method.
number & 1 == 0
Enough with this guy
I swear I've seen that on DailyWTF.
This code is actually fucking insane. If it ever occurs to you that your code is tedious and seems wrong, it’s because it is
(i & 1) is false for even and true for odd
am i doing it right? 🤣
def is_even(x):
switch = [17, 0]
idx = 0
if x < 0:
x = -x
def step(n, depth, sw, index):
if n == 0:
return sw[0]
if n % 2 == 0:
index = 1 - index
else:
index = (index + 1) % 2
if sw[index] == 17:
sw[index] = 0
elif sw[index] == 0:
sw[index] = 17
else:
sw[index] = 99
return step(n - 1, depth + 1, sw, index)
result = step(x, 0, switch, idx)
if result == 17:
return 17
elif result == 0:
return 0
else:
return 42
for k in range(10):
print(f"{k}: {'even' if is_even(k)==17 else 'odd'}")
Allow me to show something that many of y'all have never seen before...straight outta z/OS. Isn't it so pretty? Oh my days are full of this...this and JCL, and DFSORT and ICETOOL and DSNUTILB.
WORKING STORAGE SECTION.
01 MY-RESULT PIC X(1).
88 EVEN-NUM VALUE 0.
PROCEDURE DIVISION.
PERFORM 1000-MAIN-PARAGRAPH THRU 1000-EXIT
IF EVEN-NUM THEN
DISPLAY "YES, YOUR NUMBER IS EVEN. FIND A BETTER USE FOR YOUR MAINFRAME"
END-IF
GOBACK
.
**********************
* ODD/EVEN CHECK*
**********************
1000-MAIN-PARAGRAPH.
MOVE 1 TO MY-RESULT
DIVIDE LINKAGE-SECTION-NUMBER BY 2 GIVING WORKING-STORAGE-RESULT
REMAINDER WORKING-STORAGE-REMAINDER
If WORKING-STORAGE-REMAINDER = 0 THEN
SET EVEN-NUM-VALUE TO TRUE
ELSE
DISPLAY "ODD NUMBER"
END-IF.
1000-EXIT.
EXIT.
Bro somehow one-upped yandere dev
The only thing PirateSoftware has pirated was people’s confidence in his skills
Gross, I guess they didn’t know about modulus operator
This guy saw undertake code, thought it was peak, and copied it without any of the other skills
Make sure you stick a modulo 22 on your input so you can use just the statements shown.
Why the hell would you do it that way? There are no curly braces in sight!
As a second generation Blizzard Entertainment employee he should know better
Gotta love a vibe coder making fun of other people's code ...
Second coming of yandere dev ain't no fucking way
I laughed because a month ago I needed to check if a number was even or not.
number & 1 ftw
🤣🤣🤣
I could write and in fact, have written a better way to check if a number is even and I’m a fucking college dropout who doesn’t even program anymore.
Since it always returns on the first true “if”, do the “else”s make any difference here? I guess that’s up to the compiler so probably no difference if the else’s are there or not?
Are you... new to programming or joking? Or use a lamguage that has this behaviour? Sry, but as this is a meme channel, I don't want to explain it, if you are just joking around.
the PS hate is perpetual - leave the man alone isn't it enough yet?
Could... Could we not just... loop over the numbers and modulo them by two so if it returns a 0 it's true and 1 if false?
Better, you can instantly return number % 2 == 0.
if(number%2 == 0) return true; else return false;
So simple 0_o
Most languages can instantly return it. Like
return number % 2 == 0;
and done.
We love making bad people famous, huh
Jokes on you I hardcoded the compiler with this exact case so it is actually efficient
I’m confused. Is having a job at Company impressive to Gen Z?
Based on videos I have seen I'm willing to say a lot of these are stylistic in nature but the one that drives me most up a wall is magic values. I have a personal vendeta against magic numbers, you would think they murdered my wife. I will not let those through when I review code
appearently int is_even (int number) {return ((number+1)%2);} is too complex.
This is un ironically a meme for bad programmers on the programming hummor subreddit, surely he is jokeing at this point because there is just no way he is that bad at programming..
The Yanderedev algorithm.
That must have taken a long time to finish
Rent free
public bool IsEven(int number) => number % 2 == 0;
Simplest.
Does the gamemaker scripting language support negation and non-zero as 'true'?
Because in that case, it's sufficient to test isEven as !(int_val % 2)
I am on my phone and I wasn't sure if md worked so I submitted my edit to make it neat.
I was going for C#, so that won't work. Implicitly handled languages it does work on.
Nope. Modulo uses a division, multiplication and subtraction. From a perf standpoint, this is the simplest:
bool IsEven(int number) { return !(bool)(number&1); }
The premise is you're checking if the last binary digit is a 1 or a 0, if it's a 1, you get 1, if it's a 0, you get 0. Cast to a bool and flip it (to get even), and bing bang boom.
Performance wise only. I take readability into account, because if you divide a number by two, you will either get an equal or unequal division. This is the easiest to grasp, while in your case where having to work with bools and casting can become confusing.
Triple equals, found the Javascript dev.
Typo.
Chatgpt, please generate with this pattern up to 10000
No wonder it has taken him 10 ish uears to develop the game dude had to write down 232 lines of code just to check even number. That may not be efficient but thats DEDICATION
No difference for the end user, so it's just a matter of preference.
no he didn't
he developed this one:
//checks if integer is even
public static bool isEven(int integer_to_check_is_even) {
int is_even = false;
switch (integer_to_check_is_even) {
case 0:
is_even = 17;
case 1:
is_even = 0;
default:
is_even = isEven(integer_to_check_is_even - 2) ? 17 : 0;
if (is_even == 17) {
//the value is even
return true;
}else (is_even == 0) {
//the value is not even
return false;
}
}
I...Is is so late that I am in delirium or is this whole code completely batshit crazy? Why a switch case? why 17 and 0? Why does he assign a boolean value to an integer? Does he even check the right variable there? I feel like not.
It’s making fun of the fact that PirateSoftware uses 0/1 ints instead of bools, a lot of magic numbers, and dead code
You know, this does wonders for my imposter syndrome. We need more of this.
It's programmers like him that mean I never had impostor syndrome!
I'm not a great developer, just for hobby kind of thing yknow. I'll be the first to admit I know barely anything. But damn I feel better about my current skills after this fiasco.
Squeaky wheel is definitely getting the kick rn
I thank god every day that my code will never receive this kind of public scrutiny. I’d die
Further proof the best code is the code that works.
Wait, so it's just that 7 bits isn't enough waste per bool for him?
At least it's not in a struct with a 64-bit int.
we are in the age of windows 11 and google chrome
7 bits of waste is a speck of microplasic
I won't comment on the dead code and magic numbers but GameMaker did not have boolean data types at all until very recently. Anything < 0.5 is false and any value >0.5 is true.
If he started the project in 2018, it's not feasible to refactor it by now.
"Note that currently GameMaker will interpret a real number equal to or below 0.5 as a false value, and any real number greater than 0.5 as being true. This does not mean however that you should be checking 1 and 0 (or any other real number) for true and false, as you are also provided with the constants true and false, which should always be used in your code to prevent any issues should real boolean data types be added in a future update."
GameMaker has no boolean types? Why? How? What?
I checked the manual, it does now, but not so long ago it did not. I had the same reaction as you when I first found out.
If you google it you'll come across reddit threads from 2018 and 2019 saying GameMakers has no booleans.
https://forum.gamemaker.io/index.php?threads/questions-about-variables-true-false-int-string-etc.5399/post-39574
Comment from August 22, 2016.
"There's nothing like actual booleans in GML. In fact, true and false are built-in constants (Macros) that hold the values 1 and 0 respectively. So when you run this code:
Code:
jack = true;
...you're actually setting jack to 1."
0.5 is evaluated as false... That can't be right. Can it? Nobody would do that, would they? Not even Brendan Eich would do that.
I like to use 0.22 and 0.73 as my booleans
As a frequently embedded C developer, that is the most horrifying (real) implementation of booleans I've ever heard of.
God gave us Zero and Zeron't, and those are the only two numbers we as flawed sinners deserve to use.
Why not? Isn't the whole point of refactoring the modernisation of old, unmaintainable code.
You should see the dead code I work on. There's some programs that are 280,000 lines of code. Nobody knows what it does, we just know it's important. Chock full of GO-TOs and uncommented business logic with magic numbers. It's amazing.
The joys of working on a mainframe with code twice my age...
I mean dead code is always a part of code in big corpo; doesn’t mean it is excusable on a one man project
Not quite the same thing but, my previous job I worked on an 18 year old Java code base. Holy actual shit. The amount of telescoping constructors made me want to blow my brains out. The sheer level of abstractness such that nothing was easy to actually find what it fucking DID when you did something was staggering.
It ended up being easier to simply wrap everything, kinda say fuck it, and just put something over it that did what I needed it to do, because the codebase was so obtuse it was impossible to know what any change to a lower level component might cascade into.
Just to be clear, coming from a C background I also use 0/1 unsigneds for boolean. That's not a heinous offense unless there's some language with some really weird nuance about efficiency for booleans vs. integers. But if you're in a language like that you're probably not too worried about efficiency.
To be clear the above is a joke/hyperbole of his actual code.
3, is a magic numbaaa!
Is... that a reference? I have not seen a lot of pirate software except a few youtube shorts that sometimes popped up in my feed.
It’s a song lyric
https://schoolhouserock.fandom.com/wiki/Three_Is_a_Magic_Number
You forgot to add the obvious comments that say the english version of what the next line of code does for every single line of code
This is what I did for my uni assignments when the instructions said document ALL code or lose marks.. can't take any risks
I can tell that's not actually his code because it contains booleans.
This is beautiful. The more I look, the more errors I find.
Incredible.
Actually a clever workaround IF modulus never existed
It's actually quite terrible if modulus never existed because the last bit of an integer tells you if it's even or odd so you only really need bitshift, which is constant time and much better than just recursively subtracting by 2. I call this the stack overflow solution because for any number large enough your program will crash by, you guessed it, stack overflow.
Actually I forgot about stack overflows
:(
Shame it's infinite recursion, and it's not a tail call so stack overflow here we come
wait that last if statement will never even be called
whoops. yeah I kind of thought of the "stack overflow" solution and then tried to add weird integer booleans but I had to finish the comment in like 5 seconds so I made a lot of errors. I'm still gonna keep some in though because they are funny.
more like 'is_even_true = 0'
This implies he knows what ternary operator is
I may be completely wrong, but wouldn’t this work for what he’s trying to do
public static bool IsEven(int number) { return number % 2 == 0; }