ProgrammerHumor

developedThisAlgorithmBackWhenIWorkedForBlizzard

developedThisAlgorithmBackWhenIWorkedForBlizzard
https://i.redd.it/xezszc31hxcf1.jpeg
Reddit

Discussion

Embarrassed_Steak371

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;

}

}

5 hours ago
Lasadon
:j: :py: :powershell:

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.

4 hours ago
Brighttalonflame

It’s making fun of the fact that PirateSoftware uses 0/1 ints instead of bools, a lot of magic numbers, and dead code

4 hours ago
Lasadon
:j: :py: :powershell:

You know, this does wonders for my imposter syndrome. We need more of this.

4 hours ago
SpaceCadet87

It's programmers like him that mean I never had impostor syndrome!

4 hours ago
Imkindofslow

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.

9 minutes ago
Zozorak

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.

2 hours ago
morganrbvn

I thank god every day that my code will never receive this kind of public scrutiny. I’d die

1 hour ago
szerdarino

Squeaky wheel is definitely getting the kick rn

4 hours ago
FreeWilly1337

Further proof the best code is the code that works.

4 hours ago
SpaceCadet87

Wait, so it's just that 7 bits isn't enough waste per bool for him?

4 hours ago
Usual_Office_1740

At least it's not in a struct with a 64-bit int.

4 hours ago
cute_spider

we are in the age of windows 11 and google chrome

7 bits of waste is a speck of microplasic

3 hours ago
Cefalopodul

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.

4 hours ago
Kelfaren

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

4 hours ago
Lasadon
:j: :py: :powershell:

GameMaker has no boolean types? Why? How? What?

4 hours ago
Cefalopodul

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.

4 hours ago
sychs

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

1 hour ago
terivia

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.

2 hours ago
card-board-board

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.

3 hours ago
i_wear_green_pants

I like to use 0.22 and 0.73 as my booleans

34 minutes ago
readthetda

If he started the project in 2018, it's not feasible to refactor it by now.

Why not? Isn't the whole point of refactoring the modernisation of old, unmaintainable code.

1 hour ago
AdventurousTap2171

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

3 hours ago
Brighttalonflame

I mean dead code is always a part of code in big corpo; doesn’t mean it is excusable on a one man project

2 hours ago
EchoLocation8

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.

1 hour ago
CitizenShips

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.

2 hours ago
Brighttalonflame

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

23 minutes ago
not_a_burner0456025

No, but the mockery comes for his (incorrect) claims that the language doesn't have true/false, and for mocking the get who suggested that using them would be more readable and potentially less error prone, and then when proven wrong claiming that using booleans is bad practice.

1 minute ago
DrShocker

To be clear the above is a joke/hyperbole of his actual code.

4 hours ago
The_Shryk
:g:

3, is a magic numbaaa!

4 hours ago
Lasadon
:j: :py: :powershell:

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.

4 hours ago
testaccountyouknow

It’s a song lyric

4 hours ago
LongDunkDong
:cp::py:

https://schoolhouserock.fandom.com/wiki/Three_Is_a_Magic_Number

1 hour ago
not_a_burner0456025

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.

11 minutes ago
TripleATeam

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

4 hours ago
ErJio

This is what I did for my uni assignments when the instructions said document ALL code or lose marks.. can't take any risks

1 hour ago
DezXerneas
:py: :r:

This is the part I don't understand lol. Everyone writes shitty code(okay not as badd as PS), but why does he explain WHAT his code does? You need to explain WHY it's doing what it does.

13 minutes ago
_v3nd3tt4

I can tell that's not actually his code because it contains booleans.

4 hours ago
FalconClaws059

This is beautiful. The more I look, the more errors I find.

Incredible.

4 hours ago
HEYO19191

Actually a clever workaround IF modulus never existed

2 hours ago
Embarrassed_Steak371

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.

2 hours ago
HEYO19191

Actually I forgot about stack overflows

:(

2 hours ago
Qwertycube10

Shame it's infinite recursion, and it's not a tail call so stack overflow here we come

2 hours ago
Cat7o0

wait that last if statement will never even be called

3 hours ago
Embarrassed_Steak371

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.

3 hours ago
SweetBabyAlaska
:zig::c::g:

more like 'is_even_true = 0'

2 hours ago
Samurai_Mac1
:p::py::msl::js::ts::cs:

This implies he knows what ternary operator is

1 hour ago
Kbrickley

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; }

1 hour ago
mjaber95
:py:

What an idiot, he could’ve used a hash-map

5 hours ago
_unicorn_irl

He should at least delete the odd numbers and just use a default return.

4 hours ago
Mars_Bear2552
:cp:

absolutely not. that would make a little sense

4 hours ago
UntestedMethod

VeRbOsE cOdE iS mOaR rEaDaBlE

(yes, I know it can be for sure, but... not like this monstrosity in OP)

4 hours ago
extremehogcranker

She was a float x,j,jx,xx girl, he was a LocalCompServiceAbstractFactoryBeanInjectorProviderFactoryFacade boy.

4 hours ago
Mars_Bear2552
:cp:

thanks Sun

4 hours ago
sebjapon

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

4 hours ago
extremehogcranker

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 😎 

4 hours ago
Diligent_Rush8764

Are you single stud?

1 hour ago
compound-interest

I’m about to send you to a permanent hash-nap

3 hours ago
hollowman8904

Need that O(1) complexity

4 hours ago
mlk

I just had a flashback of my colleagues java code where every function took a hashmap as an argument and modified it.

42 minutes ago
i_wear_green_pants
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
27 minutes ago
queen-adreena
:js::p::msl:

Anyone see the latest Code Jesus video benchmarking his game code?

It got 19 fps from rendering a single object.

4 hours ago
Big_Spence

Didn’t he say something like it was redrawing the same sprite 80,000 times?

Absolute mad lad

1 hour ago
LuminanceGayming

this was on an 800x100 sprite for reference, so redrawing the entire sprite for every single pixel in the sprite.

1 hour ago
Big_Spence

Carmack watch out we got a visionary on our hands

42 minutes ago
iemfi

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.

59 minutes ago
hotstickywaffle

I feel like everyone was all about Thor for a while, and then all of a sudden people turned on him quick

4 hours ago
DrakeNorris

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.

2 hours ago
DrakeNorris

Just to mention a few of the smaller things that came out over both of these 2 bigger dramas.

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

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

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

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

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

2 hours ago
haklor

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.

1 hour ago
takahashi01
:g:

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.

1 hour ago
AnachronisticPenguin

It’s the cycle of the internet. Vibes rule all.

4 hours ago
Otterable

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.

2 hours ago
MadeByHideoForHideo

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.

3 hours ago
drea2
:kt:

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

2 hours ago
xKyubi

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

2 hours ago
SuperCaptainMan

Mainly because he isn’t all that he cracked himself up to be

2 hours ago
xLuky

Thats just how being famous on the internet works, the pendulum always swings back.

4 hours ago
whutchamacallit

I seriously doubt the broader community will ever see him favorably ever again.

2 hours ago
xLuky

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.

1 hour ago
Animal31

People just want attention

4 hours ago
SweetBabyAlaska
:zig::c::g:

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

2 hours ago
TUSF

He just showed up one day on my Youtube shorts feed, so I watched some of his shorts for a while, and that's about it. Then I saw his opinion on Stop Killing Games, and actively started skipping his videos whenever they popped up, until Youtube stopped recommending him to me.

This is my first time hearing about him in nearly a year or so.

2 minutes ago
aeristheangelofdeath
:cp:

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

5 hours ago
beclops
:sw:

“I made my code shitty and unworkable on purpose, it’s an ARG of course”

4 hours ago
aeristheangelofdeath
:cp:

“QA are also developers and I was a QA at Blizzard so I am a developer with 20 years of experience”

4 hours ago
Pleasant_Ad_2080

Oh I get it the ARG is to fix the code.

4 hours ago
Sw429
:rust:

I'm dumb, what's ARG stand for?

9 minutes ago
septum-funk

i've used gms. almost everyone who uses it writes bad code like this because gml is a shitty and inconstant language

2 hours ago
i_love_boobies_3000
:py:

New to this, what are ARG and GMS?

1 hour ago
Etheo
:bash::py::table_flip::redditplatinum:

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)

17 minutes ago
i_love_boobies_3000
:py:

Thank you :) that helps

12 minutes ago
Cefalopodul

In all fairness Game Maker did not have boolean data type back in 2018.

4 hours ago
PhilosophicalGoof

Really? That sound like a very basic feature to miss.

1 hour ago
PeksyTiger

I mean c didn't have it until c99 and you need to include a header for it

40 minutes ago
Sw429
:rust:

C didn't have one either.

4 minutes ago
chazzeromus

gamemaker is how I got into this when I was a wee lad, funny how it’s coming back to haunt me

3 hours ago
Sw429
:rust:

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.

3 minutes ago
SweetBabyAlaska
:zig::c::g:

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.

2 hours ago
OutlandishnessLow779

I have no fucking idea about programming, yet i know that is ineficient as hell

29 minutes ago
Aggravating_Dot9657

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

2 hours ago
GoddammitDontShootMe
:c::cp::asm:

Isn't there enough real shit from this guy's code that we don't need to make stuff up?

3 hours ago
Knight_Of_Stars
:cp:

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.

1 hour ago
dodev

yanderedev jump scare

5 hours ago
X145E

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

5 hours ago
beclops
:sw:

QA*

4 hours ago
_v3nd3tt4

He was an elite government hacker in case you weren't aware.

4 hours ago
RobRobbieRobertson

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

4 hours ago
QuickQuirk

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.

3 hours ago
Freecraghack_

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

1 hour ago
p_heoni_x

bash npm install is-even

4 hours ago
starrycrab

Adding this guy to any programming intern meme is peak 🤣

4 hours ago
MixaLv

Clearly fake, Thor hates bools and often uses ints instead to store true/false

4 hours ago
BiasHyperion784
:j::c::py::powershell:

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.

2 hours ago
CascadiaHobbySupply

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.

58 minutes ago
BiasHyperion784
:j::c::py::powershell:

Yeah, I have read that reading the bit is what some languages do under the hood with mod 2 as well.

50 minutes ago
Detective_Dumbass

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: -";

3 hours ago
glow3th

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! 😭

3 hours ago
Kazagan

Inaccurate, based on what I've seen, there aren't enough comments in this to be PirateSoftware code

4 hours ago
n8LovesSD

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

3 hours ago
APirateAndAJedi

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

3 hours ago
SaltyStratosphere

3 hours ago
FriendlyBergTroll

Is this an actual code snippet of his or just a meme ☠️

2 hours ago
Monkey_Slogan

As simple as it can get, production level code!!!

1 hour ago
L4t3xs
:unity: :cs: :lua: :py:

Congrats buddy. You are on the array now.

13 minutes ago
DaMoonRulez_1

Shouldn't those all be 0 and 1 instead of false and true? Based on other code I saw of his.

5 hours ago
DefiantFoundation66

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.

4 hours ago
Furyful_Fawful

yeah, but piratesoftware doesn't use the words false and true when the numbers 0 and 1 suffice

4 hours ago
Creeperslayers6

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

4 hours ago
DaveK142

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)

}

4 hours ago
jax_cooper
:py::gd::ts::bash:

Give this guy a break, man xd

4 hours ago
FatBussyFemboys

I'm newer to programming and seeing this guy get roasted for mistakes I don't even understand is kinda demoralizing. Can we chill?

3 hours ago
Knight_Of_Stars
:cp:

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.

1 hour ago
mojio33

When coders and vibe coders agree with this being crap

4 hours ago
OkDeveloper4096

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;           }      } }

```

4 hours ago
TheOneWhoWil

Giant array of bools, use the number as an index

4 hours ago
Dull_Warthog_3389

Lol

4 hours ago
linux1970

IsEven(Num): If Num >2: Return isEven(num-2) Return num 1=2

4 hours ago
dagbiker

return n & 0b01;

4 hours ago
drillgorg

They should truncate it to only the final digit of the input. Then this would be a legitimate method.

4 hours ago
large_crimson_canine

number & 1 == 0

4 hours ago
RhinoRoundhouse

Enough with this guy

3 hours ago
IntentionQuirky9957

I swear I've seen that on DailyWTF.

3 hours ago
UntrimmedBagel
:cs::py:

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

3 hours ago
DysonSphere75
:c::cp::j::sc:

(i & 1) is false for even and true for odd

2 hours ago
Spiritual-Nature-728

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'}")

2 hours ago
AdventurousTap2171

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.

2 hours ago
BlizzTube

Bro somehow one-upped yandere dev

2 hours ago
philippefutureboy

The only thing PirateSoftware has pirated was people’s confidence in his skills

2 hours ago
MountainRub3543

Gross, I guess they didn’t know about modulus operator

2 hours ago
AnnualAdventurous169

This guy saw undertake code, thought it was peak, and copied it without any of the other skills

2 hours ago
experimental1212

Make sure you stick a modulo 22 on your input so you can use just the statements shown.

2 hours ago
RogerGodzilla99

Why the hell would you do it that way? There are no curly braces in sight!

2 hours ago
Notallowedhe

As a second generation Blizzard Entertainment employee he should know better

2 hours ago
calahil

Gotta love a vibe coder making fun of other people's code ...

2 hours ago
Anbcdeptraivkl

Second coming of yandere dev ain't no fucking way

1 hour ago
HalifaxRoad
:c::cs::asm:

I laughed because a month ago I needed to check if a number was even or not.

number & 1   ftw

1 hour ago
HelloBloop

🤣🤣🤣

1 hour ago
ComicBookFanatic97
:cp::py:

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.

1 hour ago
Away-Surprise-3627

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?

1 hour ago
CaptainAgura

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.

43 minutes ago
HOLY_TERRA_TRUTH

the PS hate is perpetual - leave the man alone isn't it enough yet?

1 hour ago
SetazeR

Finally, someone with common sense.

11 minutes ago
Pixelite22

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?

50 minutes ago
CaptainAgura

Better, you can instantly return number % 2 == 0.

45 minutes ago
Pixelite22

Oh wait true!

It was so weirdly written that I misread it, didn't realize the function was recieving a number and thought it was looping through a set of numbers because of all the lines with nothing but a number and the bool result being different

13 seconds ago
Danonmyneck

if(number%2 == 0) return true; else return false;

So simple 0_o

46 minutes ago
CaptainAgura

Most languages can instantly return it. Like

return number % 2 == 0;

and done.

42 minutes ago
eitaLasqueirinha

We love making bad people famous, huh

45 minutes ago
Electronic_Blood_467

Jokes on you I hardcoded the compiler with this exact case so it is actually efficient

36 minutes ago
Orderly_Liquidation

I’m confused. Is having a job at Company impressive to Gen Z?

36 minutes ago
killersinarhur

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

34 minutes ago
No_Unused_Names_Left

appearently int is_even (int number) {return ((number+1)%2);} is too complex.

33 minutes ago
Easy_Floss

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

32 minutes ago
StupidIdiot1954

The Yanderedev algorithm.

31 minutes ago
Throwaway_987654634

That must have taken a long time to finish

25 minutes ago
ivanthenerd

I don't even know a single thing about programming, and i can still tell that, ts ain't supposed to be that long bro.

23 minutes ago
Ecstatic-Star-514
:js:

then they fired you?

7 minutes ago
atanasius

Maybe it worked back then, but branches are slow on modern processors.

2 minutes ago