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
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
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
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
I think that was just the collision checks
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.
This pretty much. Tho the code should be moved to the GPU instead of having it run on the CPU, via a shader. That would be the only complaint I have about that part.
Also the first 2 minor ones could be compiler and decompiler artifacts. Which is also sad that those issues were focused on too when it could be explained away as compiler and decompiler artifacts. You would think that Code Jesus would know that.
Also the unsafe I/O could have been because Gamemaker game engine says that it guarantees certain places on the computer will be read and write safe. And those methods for reading and writing are error safe too. So even if the file isn't there, the reading and writing operations will be skipped and no error will be thrown. So having those checks aren't really needed.
I don't know how finnicky the shader stuff is in GML but I think it's easy to forgive not bothering with a shader if the naive way is performant enough. It's not something that well suited for GPUs anyway and I assume fiddling with shaders like that in Gamemaker is a nightmare. Frankly the feedback should probably be if you want stuff like that just switch engine lol.
it was sub-optimal but from what i understood it didn't had that terrible performance in the game, mostly because the example used was the code with the conditional set to true at all times, so it never stopped running, theoretically it has a condition that prevents it from running if nothing changed for that sprite, but the coder in the video make a incredibly better code nonetheless
i just found misleading the example used making it seem the game is that horribly optimized, although that's a shitty as way of doing it and will still lead to bad performance regardless
example used was the code with the conditional set to true at all times, so it never stopped running, theoretically it has a condition that prevents it from running if nothing changed for that sprite, but the coder in the video make a incredibly better code nonetheless
One thing to point out, the light solution that the coder put in the video, sure it runs better, but the final image would be different. It seems that Thor's version is essentially a directional light that is essentially ray traced pixel by pixel and it stops a bit after a collision is detected per each ray (or x axis trace).
While the 2d stencil lighting wouldn't be doing shadows and would be lighting the whole stencil.
This is likely why in the video, during the benchmark for the two different solutions, the outcome isn't shown. Only real issue with Thor's code for this part is that it isn't running on the GPU instead of the CPU.
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).
I can't believe how accurate this is
Honestly, this entire situation made me aware of how much information I just take for granted from short form content where a guy with charming voice says basically anything
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'm dumb, what's ARG stand for?
i've used gms. almost everyone who uses it writes bad code like this because gml is a shitty and inconstant language
Right? I didn’t think people made actual games in gms, it’s what we played around with at school. It’s like if he tried ripping off undertale using scratch lmao
Undertale was made in GMS.
Edit: I'll be here waiting for you to delete your comment in shame.
New to this, what are ARG and GMS?
I'm guessing Alternate Reality Game (i.e. making it a sort of game with mixed reality elements) and Game Maker Studio (a software for Game Development)
gamemaker is how I got into this when I was a wee lad, funny how it’s coming back to haunt me
I was more of an RPG Maker XP kid myself. I started so many projects that went absolutely nowhere and all looked the exact same.
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
game maker was made after the prehistoric era though
No, but it did have a crappy enum based implementation that works about as well as a proper one for a loosely typed language done at least 2016 and the documentation says to always use it instead of 1/0 (nobody seems to be able to find when it was added, but they were able to find people quoting that specific part of the documentatiom dated to 2016).
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.
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.
Couple of pieces of context for points 3 and 5, there are clips of him speaking at streamer events where his voice DOES sound like on his stream, so it's much more likely he's done vocal training to make his voice sound the way it does, which is honestly whatever, this is the one thing in all of this that really rubs me personally the wrong way (am trans, have done vocal training, it's a frankly weird thing to get hung up on)
For point 5, there IS technically (very flimsy) evidence of him doing work with power plants, it's on his linkedin, and he wasn't a hacker like he keeps stating, he was a pen tester, basically a social engineer writing phishing emails and getting through security with a high vis and clipboard
ETA I fucking hate the guy lmao
isnt a pen tester kind of a hacker ? you do try to access thing you shouldnt to find weakness in a system.
One more thing to add that happened to me and also to a bunch of other people from what I read:
This guy kept showing up in my Youtube shorts feed. I kept swiping him away and disliking the clips, but they kept reappearing. Nothing too bad, just him being a smartass. He was riding the algorithm.
I imagine that in addition to getting new fans it also got him more people who were ready for a reason to dislike this dude that was annoying to them.
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.
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.
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.
People just want attention
Thats just how being famous on the internet works, the pendulum always swings back.
The WoW classic thing gave a lot of his haters something to attack him with, but he always had a shit ton of haters. The SKG thing is now also making them go rabid.
The code thing is the most moot thing I've ever seen. Literally just people that are armchair programmers criticising code made for a game engine that held by hopes and dreams (Undertale pun intended).
Not a single one of the decent tech Youtubers is actually jumping into this shit for a reason.
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
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
how did he misrepresented it ?
I don't get what you're on about. He was a QA. He's always said so.
Genuinely sick of the hate train. Might block this sub till people forget about his ass. I love programming memes, but posts about Thor is the only shit I see from this sub anymore.
Mainly because he isn’t all that he cracked himself up to be
Mom said it’s my turn to karma farm off the hate mob.
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.
Nah the best code is written when I take an edible and start asking chatgpt incoherent questions.
80% of this sub hasn't programmed anything further than bubble sort. They probably wouldn't understand it anyways.
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*
Quality 'n' Assurance
He was an elite government hacker in case you weren't aware.
Fake, not his code - he doesn't use booleans.
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
...
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
I yield.
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.
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.
It's not really about language but about compiler optimizations. However turning x%2 into x&1 is one of the most basic optimizations that you can expect from pretty much any compiler for a statically typed language.
bash
npm install is-even
Adding this guy to any programming intern meme is peak 🤣
Clearly fake, Thor hates bools and often uses ints instead to store true/false
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
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.
This is un ironically a meme for bad programmers on the programming humor subreddit, surely he is joking at this point because there is just no way he is that bad at programming..
Edit : I did not look at the subreddit name on my phone haha
Is this sub just for pirate shitposting nowadays?
Where did people get his code anyway? And why wasn't it shared earlier?
I don’t know who he or she is, but I’m tired of seeing the fifth screenshot with him or her.
Shouldn't just this work here? I'm not experienced in this programming language though or the function behind it, but:
private bool IsEven(int number)
{
return number % 2 == 0;
}
yeah the joke is that he is so incompetent that he is using a very inefficient way to solve a problem
Wow low effort meme. Just to hate on a streamer congrats.
You people enjoy ripping this guy apart way too much
As simple as it can get, production level code!!!
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
Meanwhile he also has a class to check if 7 is 7 pretty much
you forgot a comment before every else if statement
There's not nearly enough comments here for him
So... Who is this guy?
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
Enough with this guy
Rent free
Give this guy a break, man xd
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)
}
Is there an in-depth video of how bad his code is?
Coding Jesus made nice video about it.
Its mainly issues with ignoring standart conventions when coding, readability, ignoring the documentation.
Like, you would really not expect stuff like that in code made by someone who claims to have so much experience.
In not getting all the recent hate for Pirate software
I wondered abt this too a while back, cause i always loved his streams & videos. So i dug into it as much as i cared to with some google searches.
All i could find was a bunch of Gamers (derogatory) claiming that he personally destroyed the Stop Killing Games movement (or at least played a large part in it losing traction)
The accusations range from saying he ran a deliberate misinformation campaign to saying that he was just too unintelligent to understand it properly and spread bad ideas about it.
At the heart of the matter, i found a clip he made where he, somewhat unkindly stated that he does not support the movement and will not be giving it any support to it in the future. The tone he took seemed, to me, to be one of exasperation (ie. "please stop asking me about this"). But many seem to have interpreted it as hostility and condescension.
He put his reasoning (which i found rather compelling) for not supporting the movement in a text post or description somewhere and left it at that.
From then on it seemed to snowball into a true internet flame war as people dug in and worked backward from "i dont like him" to "his content must be bad" and on to "he must have been a moron all along." It has now become a meme in some circles to use him as a meme shorthand for "bad coder who condescendingly thinks he's a professional"
Hell, maybe im wrong and missing gigantic pieces, but i dont care to investigate internet flamewars any deeper than this.
lmao
I think he's annoying and arrogant too, but I truly think the internet is taking it too far on him. He lost, and the initiative seems to be winning. I think the internet should stop bullying him.
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!
To be fair you probably cant find programmers like him just anywhere, his father worked for blizzard and totally did not get him a job there.
For the amount he talks about his dad i was surprised to learn he doesn't wish him happy birthday and even jokes about that when he gets called out by his dad on stream.
https://www.reddit.com/r/LivestreamFail/comments/1lyw8yk/old_clip_how_pirate_software_treats_his_dad_that/
Its even weirder how his dad needs to correct himself on calling him Thor instead of his actual name "Jason" as if this was a request by Pirate.
Weirdest one for me was seeing him brag about his dad being the inspiration of the WoW gamer in South Park. That's not exactly a flattering representation of him
Its not flattering but I kinda get it. Appearing at all in a show that popular is kinda cool.
You can generally find them as Week 1 Interns who skipped college
Is any of this stuff actually his shit because I see it here all the time and I swear to God nobody straight up offers a source for any of it. I can't tell if y'all are being shit lords or just actually dicks.
Oh no, this screenshot is an old one (I seem to recall it being thrown around as part of either yandere simulator or undertale). His code is more characterised by storing boolean values as integers, loads of magic numbers and just commenting everything with complete disregard as to whether the comments are useful.
Thank you for clarifying.
Sounds like just about every legacy codebase I've ever worked on... So... Business as usual?
This screenshot above is just a combination of Pirate software's head being placed over an older screenshot which was a joke about bad programmers. The screenshot has been then misattributed to a variety of sources including Yandere Dev and various other people who have been mocked for poorly optimized code.
I have not seen enough of Pirate Software's code to make a value judgment about it
I thank god every day that my code will never receive this kind of public scrutiny. I’d die
You presumably aren't calling people idiots for correctly suggesting that your programming language has booleans, so you are miles ahead of him.
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
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.
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.
``` typedef struct {
int64_t true; //Set to 1 if true
int64_t false; //Set to 1 if false
} bool; ```
we are in the age of windows 11 and google chrome
7 bits of waste is a speck of microplasic
Optimizing space is a lost art because it's simply not relevant at that scale any more with current hardware.
Further proof the best code is the code that works.
The best code is the code that is not commented out
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.
Yeah it’s not that heinous; I’m just saying what the post is making fun of. Unless you’re space optimizing with bit vectors basically every language isn’t going to get performance boosts from using booleans instead of bytes since basically every system is at best byte-addressable; it’s just a readability and static analysis thing primarily
It is not a heinous offense but it has readability issues. Even if the programming language doesn't give you the data type, at least make an alias, or use the one given to you in this case.
And even if you make the argument that it's fine because no one else is going to read your code, the you from tomorrow will probably have forgotten some of the things you did today, so imagine the you 8 years from now.
There's also his lighting code which does a morbillion checks per sprite on screen per frame
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.
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.
"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."
To be fair, this is also how c++ works. You have to add extra code to actually get a single-bit Boolean, and under the hood it just stores a 0 or 1 when you set something to true or false.
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
I request changes
Why not? Isn't the whole point of refactoring the modernisation of old, unmaintainable code.
But also the point is completely nonsense, it has had the and crappy enum based implementation of booleans since at least 2016, before development on heat bound started.
He doesn't even use 0 and 1, he uses 0 and 42. Why the fuck 42?
To be clear the above is a joke/hyperbole of his actual code.
When coding Jesus reviewed some of his public coffee, CJ pointed out that PS should use true/false instead of 1/0 for binary values because it is more readable and less error prone. PS responded by implying CJ was an idiot and asserting that game maker studio doesn't have booleans (not only does it, but PS actually used a couple in the code that CJ was reviewing, but only in a fraction of the places it would be appropriate to use booleans). After CJ pointed out that Game maker does in fact have Boolean values (for some reason the developers decided not to natively support booleans but they do have an enum with TRUE/FALSE and recommend that developers use them in case they add true boolean support in the future, also they made any value less than 0.5 false for some reason, but none of this really matters) PS decided to shift the goalposts and claim that using booleans is bad programming.
The issue is that CJ comes across as an idiot as well. Instead of staying professional he is going after stuff that are essentially nitpicks. There are way better takes on this on YouTube, as there is a lot of other code much more deserving of criticism. I feel like his reviews are among the worse ones.
It does make some sense to hold PS code to a higher standard given that this is apparently what he's teaching to beginners.
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
It's like when in elementary school you had to write out 63 = 6 + 6 + 6 = 12 + 6 = 18 because apparently 63=18 wasn't clear enough
- u/PaleEnvironment6767, 2025
Haha, apparently asterisks format that weirdly. Meant 6 x 3 = 18
Markdown ate the asterix again
// did we already check if even?
Come on, separately single backticked lines of code? 4 spaces in front of each line does it all for you, or triple back tick code blocks like every other markdown renderer.
}
Thank you. Almost got aneurysm from reading the original code.
one brace didn't agree with you
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
:(