This is YandereDev levels of bad.
this is yanderedev.
no the code is
No, no, you should group the
return false
lines together 😤😤if (number == 1) return false; else if (number == 3) return false; else if (number == 5) return false; //... else if (number == 2) return true; else if (number == 4) return true; //...
A decent compiler will optimize this into
return maybe;
else print("number not supported");
As we’re posting examples I’ll add how lovely it is in Elixir. Elixir def not putting the fun in programmer memes do. One reason I picked it because I can’t be trusted to not be the meme.
def is_even?(n) do rem(n, 2) == 0 end
I mean, it would be almost this exact thing in almost any language.
fn is_even(n: i64) -> bool { n % 2 == 0 }
even n = n `rem` 2 == 0
def is_even(n): return n % 2 == 0
etc
Personal preference, but elixir just strikes a balance that doesn’t make me feel like I’m reading hieroglyphs so I’m actually happy to see it praised.
I would have preferred for the function to be called mod, since it’s the modulo operation, which in math is represented with a percentage or “mod”. Most programming languages use a percentage because of that, so do a lot of calculators.
Yeah, I agree that Elixir is a fine language for some tasks. I personally find the readability somewhat average, but it’s very maintainable (due to how it enables clear program structure), the error handling is great, and the lightweight process system is amazing.
Fucking rent free. Jesus Christ you clowns, I almost want them to take away all your video games now
people IRL: hey man how’s it going
I have never met anyone cool who says “rent free”
I’ve never met anyone cool who cooks up strawmen memes because they’re exhausted all their actual criticisms.
The piratesoftware shit is so tiresome. Who the fuck cares? What is this going to accomplish? He’s not even popular anymore
Who cares? You. You’re the one who knows what this even is. ReNt FrEe is always a sign of having no argument
oh no not my toys, like all good consoomers i put 99% of my self worth and identity into the things i consume mindlessly so this is devastating.
I think you got wooshed here
The guy in the picture is PirateSoftware, accused of sabotaging the Stop Killing Games initiative in the EU.
This post is part of a coordinated harassment campaign by big angy gamers because bad nerd man say companies won’t listen to their little lib demands to the EU
So instead of regrouping their efforts (which, I might add, they did, and they got their day in parliament) they (started off by) basically trashing this dude until he lost a large portion of his community. Because like they didn’t like how he defended his position. About video games. And now the fucking internet won’t shut up about it even though they got their way again through toxic bullying. And it annoys me. So I shitpost about it wherever I can because I hope it annoys them too.
There’s a lot of distorted facts here, but the weirdest one to me is “instead of regrouping their efforts (which, I might add, they did, and they got their day in parliament)”. The first half just contradicts itself (“instead of doing X, which they did, …”???) and the second half (“they got their day in parliament”) is verifiably, obviously false: The EU petition is still ongoing and collecting signatures. The deadline is July 31.
Thanks to goodness, finally. A (giggle & snort) solid algorithm. There ya’s go set yer clocks & go get a haircut.
IMO he’s ragebaiting
OP is. This is just a remix of a popular meme.
I think he’s leaning into the drama for attention, but he’s also just bad
ftfy
bool IsEven(int number) { return !IsOdd(number); } bool IsOdd(int number) { return !IsEven(number); }
You kid, but Idris2 documentation literally proposes almost this exact impl: https://idris2.readthedocs.io/en/latest/tutorial/typesfuns.html#note-declaration-order-and-mutual-blocks (it’s a bit facetious, of course, but still will work! the actual impl in the language is a lot more boring: https://github.com/idris-lang/Idris2/blob/main/libs/base/Data/Integral.idr)
I hadn’t seen Idris2. Thank you for providing me with a new rabbit hole!
I’m glad to tell more people about it. It’s really quite amazing (I could write a somewhat complex algorithm and prove some properties about it in a couple afternoons, despite limited formal verification experience) and I’m sure that in 20 odd years the ideas behind it will make it into mainstream languages, just as with ML/Haskell.
bool isEven(int value) { return (int)(((double)value / 2.0) % 1.0) * 100) != 50; }
Why is it all in italics?! I’d reject the PR just for that. Otherwise LGTM
Throwback to when someone shared the OG version of this meme to my uni chat, I replied with "Oh you can simply do
def is_even(n: int) -> boolean: if n > 0 return not is_even(n - 1) elif n < 0 return not is_even(n + 1) else return True
And instead of laughing at the joke the TA in the chat said “When you start getting internships you’ll do
n % 2
” like I was being serious.no unit tests huh.
/s
This joke was not written by the dude pictured. The author wrote a book of funny code jokes.
Y’all laugh but this man has amazing code coverage numbers.
Good if you are rated by an AI that pays for LOCs.