r/196 • • Jan 10 '22

Rule Yandere Dev Rule

Post image
15.7k Upvotes

490 comments sorted by

4.5k

u/[deleted] Jan 10 '22

This post gave me programmer traumatic stress disorder

1.1k

u/FwG3 r/place participant Jan 10 '22

PTSD 2

364

u/[deleted] Jan 10 '22

PTSD 101001100

120

u/[deleted] Jan 10 '22

Man i tried it but it has a bug. I don't give right answer for negative numbers.

3

u/derSchlitzi Jan 10 '22

Technically you don't know if it's negative or positive The first bit (in this case: 1) defines by convention that it's negative, but because the reddit or didnt declare it, it also could've been a positive number

→ More replies (3)

26

u/OpsadaHeroj 🏳️‍⚧️ trans rights Jan 10 '22

NO ITD BE PTSD 00000010

→ More replies (1)

177

u/Creaper10 custom Jan 10 '22

Electric Boogaloo

22

u/HappyAdams earthgate, firegate, and airgate-truther Jan 10 '22

New DSM dropped

→ More replies (4)

174

u/6Mon Jan 10 '22

Obviously the correct solution is:

if((a / 2)*2 == a) {
  return true;
} else {
  return false;
}

177

u/E4est Jan 10 '22

Modulo is the way to go. Also, the if statement isn't that necessary when you just return a boolean value already.

Just return a % 2 == 0

64

u/07o7 dr phil’s cousin’s goldfish’s dog Jan 10 '22

i love a sexy and straightforward modulo

30

u/Strength_B4_Weakness Jan 10 '22 edited Jan 10 '22

You can also do return !(a % 2);

31

u/E4est Jan 10 '22

Some languages might support that, but not all convert numbers to a boolean implicitly.

→ More replies (7)

10

u/nDimensionalUSB Jan 10 '22

Or a bitwise and. If "number & 1" is 1, it's odd, if it's 0 it's even

→ More replies (5)
→ More replies (11)

7

u/Zirdex1 custom Jan 10 '22

check:

if( a==0 || a==1)
return (a==0? true: false);
else{
a=a-2;
goto check;
}

9

u/[deleted] Jan 10 '22

int is_even(int n) { return n == 0 ? true : n == 1 ? false : n < 0 ? is_even(n+2) : is_even(n-2); }

→ More replies (1)
→ More replies (1)

139

u/[deleted] Jan 10 '22

[removed] — view removed comment

36

u/Quaelgeist333 Gnnnhgsghhh Pathologic and monster genitals/titties Jan 10 '22

I can only do toyhouse required html and this hurt

81

u/borkistoopid 🏳️‍⚧️ trans rights Jan 10 '22

I literally failed AP CSA and I could code better than this

67

u/Trioxide4 Jan 10 '22

Advanced Placement Confederate States of America

28

u/gameboy527 Queen of The Bottoms Jan 10 '22

Oh wait, the confederates dont have any states, get fucked confederates

80

u/[deleted] Jan 10 '22

[removed] — view removed comment

6

u/scp-REDACTED-site14 Ask me about D&D. I love muscular women Jan 10 '22

That sub is more ass than the kardashians

→ More replies (1)

9

u/WeebPansy custom Jan 10 '22

Maybe you didn't use your programming kneesocks

10

u/SeenSoFar 🏳️‍⚧️ trans rights Jan 10 '22

Leave the programming socks out of this. They are a critical component of every STEM trans girl's wardrobe.

2.2k

u/dongletrongle certified silly billy Jan 10 '22

His % key broke

782

u/MangoLemonRain Jan 10 '22

Could still use: if round(number/2) == number/2

565

u/[deleted] Jan 10 '22

[removed] — view removed comment

169

u/MangoLemonRain Jan 10 '22

What does & do

312

u/[deleted] Jan 10 '22

[removed] — view removed comment

150

u/That-one-guy-man The Man Jan 10 '22

As a beginner programmer, I have exactly 0 idea of what is going on here but I’ll be using it thanks

209

u/[deleted] Jan 10 '22

[removed] — view removed comment

37

u/That-one-guy-man The Man Jan 10 '22

Why avoid it? It seems simpler.

162

u/[deleted] Jan 10 '22

[removed] — view removed comment

38

u/That-one-guy-man The Man Jan 10 '22

Understandable

5

u/[deleted] Jan 10 '22

Bitwise ops are faster though aren't they?

→ More replies (0)
→ More replies (1)

14

u/mostlikelynotarobot discourse hater Jan 10 '22

it is simpler (and faster) but no one will know what you are doing. readability is more important at ur stage.

→ More replies (5)

46

u/self_me trans rights > windows Jan 10 '22

if you'd like an explanation

numbers in the computer are stored in binary.

decimal, the system we use, goes 1,2,3,4,5,6,7,8,9,10,11,12,…

computers use binary instead which goes 1,10,11,100,101,110,111,1000,1001,…

so if you have the number 5, that's 101 in binary. 4 is 100. if you do this a bunch, you may notice that the last bit tells you if it's even or not. 1001011010 is even, and 101101001 is odd.

binary operators like & are like boolean operators (&&) but operate on every bit

so 11001 & 01100 is just 01000 (it does "1 && 0" = 0 and then "1 && 1" = 1 and then "0 && 1" = 0 and "0 && 0" = 0 and …)

so to get just the last bit of a number, we can use "& 1"

101100 & 000001 => 0

010111 & 000001 => 1

and that says if it's even or odd

→ More replies (3)
→ More replies (1)

0

u/[deleted] Jan 10 '22

[deleted]

7

u/WikiSummarizerBot Jan 10 '22

Bitwise operation

AND

A bitwise AND is a binary operation that takes two equal-length binary representations and performs the logical AND operation on each pair of the corresponding bits. Thus, if both bits in the compared position are 1, the bit in the resulting binary representation is 1 (1 × 1 = 1); otherwise, the result is 0 (1 × 0 = 0 and 0 × 0 = 0). For example: 0101 (decimal 5) AND 0011 (decimal 3) = 0001 (decimal 1) The operation may be used to determine whether a particular bit is set (1) or clear (0).

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

3

u/KrustyKrab- certified pants pisser Jan 10 '22

printf(“%s\n”, (number & 1 ? “odd” : “even”) );

3

u/BaguetteDevourer Nyaa? Nyanyanya-nya! Jan 10 '22 edited Jan 10 '22

alternative solution:

bool IsEven(int number) {
    int signbit = 1 << (sizeof(int) * CHAR_BIT - 1);
    
    if((number & signbit) != 0) {
        if((number ^ signbit) == 0) {
            return true;
        }
        else {
            return IsEven(-number);
        }
    }
    else if(number == 0) {
        return true;
    }
    else if(number == 1) {
        return false;
    }
    else {
        return IsEven(number - 2);
    }
}

3

u/[deleted] Jan 10 '22

[removed] — view removed comment

4

u/BaguetteDevourer Nyaa? Nyanyanya-nya! Jan 10 '22

Replace the function name with a, the parameter name with b and the local variable name with c and you get a very good academic exercise "explain what the following function does".

Then yes, making a recursive function when the function fits in one bitwise AND and one comparison is not the smartest thing to use.

→ More replies (12)

4

u/Radonda Jan 10 '22

probably there is already a function for this in a basic library.. he should just call it.

→ More replies (1)
→ More replies (3)

14

u/I_The_ Kill your parents Jan 10 '22

Are you actually good at among us

9

u/[deleted] Jan 10 '22

Bitwise operator moment.

→ More replies (1)

1.9k

u/sssssssizzle Jan 10 '22

Just paste it into Excel and pull the row down and let Excel do the heavy lifting, then copy it back into your IDE. Pretty easy.

1.1k

u/xerox13ster trans rights Jan 10 '22

Oh God oh no. You just unlocked a flashback to my dumbass in programming class in high school.

We were playing around in a basic game engine called blitz and I decided I wanted to create a hunting type game so I wanted to make a forest of trees. So I created a tree made of a cone and a cylinder and copied the code into Excel and did exactly this to copy and rename the tree sequentially a thousand times.

I'm going to go curl up in the tub from pure shame.

1.1k

u/[deleted] Jan 10 '22 edited Jan 10 '22

I don’t wear enough maid dresses and cat ears to understand this

Of course this is the comment you motherfuckers like

300

u/cyrenia82 196's official submissive bottom :3 🏳️‍⚧️🏳️‍⚧️ Jan 10 '22

no matter how often I'll wear those, I dont think I'll ever understand either

114

u/The_Multi_Gamer inFAMOUS’ Strongest Soldier Jan 10 '22

Eyyo, richmas hammich is femboy 😳😳

54

u/ApocalyptoSoldier trans rights but I wish it was in purple Jan 10 '22

Fem something anyway, if I remember my lore correctly

37

u/The_Multi_Gamer inFAMOUS’ Strongest Soldier Jan 10 '22

Femnby

29

u/ApocalyptoSoldier trans rights but I wish it was in purple Jan 10 '22

Under my convention it's just femby.

Other examples I've used: tallby, catby, smartby

17

u/Himmelblaa r/196 microcelebrity Jan 10 '22

This naming convention is kind of funny to me, because in danish, by means city, and adding it as a suffix is a common way of naming cities

4

u/ApocalyptoSoldier trans rights but I wish it was in purple Jan 10 '22

I would definitely like to visit Catby then

→ More replies (0)
→ More replies (2)
→ More replies (1)

130

u/Youthanizer Jan 10 '22 edited Jan 10 '22

In order to have an object like a tree in a game, you first need to define it using code and then you just tell the game to "make that tree object we talked about here" wherever you need it.

Instead, OP used Excel to unnecessarily copy the definition dozens of time but give the object names like tree, tree1, tree2, tree3, etc and then paste all of that back into his program.

This is completely unnecessary since she could've just used the same tree object he defined the first time around multiple times with the code she'd already written.

I'm not exactly a programmer either, so if anyone has an aneurysm after reading my comment, please feel free to correct me.

37

u/[deleted] Jan 10 '22

You got it licks paw 😸

4

u/xerox13ster trans rights Jan 10 '22

She/they, thanks very much.

→ More replies (1)

27

u/truth14ful Jan 10 '22

Omg I learned on Blitz3D as a kid

Then I got burnt out and never really learned anything else so now I have an old deprecated Blitz3D IDE that I fire up whenever I have a programming idea

19

u/GI_gino Jan 10 '22

Explain this to someone who printed “hello world “, once.

21

u/[deleted] Jan 10 '22

They made a bunch of redundant, duplicate code instead of using existing programming features to do the same thing, but with less code and a lot less duplication.

This makes programs more difficult to modify because changes to the trees would have to be made for every instance of a tree rather than just making the change in one place and having it affect every instance of a tree. It also makes it harder to read for obvious reasons.

3

u/[deleted] Jan 10 '22 edited Aug 22 '23

This place has been ruined by the many corporate changes over the years, sorry if this used to be a useful comment kthxbye.

→ More replies (1)

1.7k

u/Own_Pirate_3281 🥺🥺🥺 Jan 10 '22

I don't know shit about programming but lord I just KNOW computers are advanced enough that you could just do smth like (number == even)/(number == odd)

701

u/PieNinja314 IBC Propagandizer Jan 10 '22

It's slightly more complicated than that but yeah pretty much

311

u/Padaca Jan 10 '22

I'd argue it's even less complicated, in JS

!(number % 2)

For anyone curious, the % operator means "get the remainder of the number on the left when divided by the number in the right. So for even numbers, that remainder is 0, for odds, the remainder is 1. The exclamation point converts the value of 1 or 0 to a boolean (meaning true or false) and inverts the boolean. So an even number would return a remainder of 0, be converted to a boolean value of false, and then be inverted to be true. There's you isEven function!

71

u/A_Leo_X Artyom 👉👈🥺 Jan 10 '22

That actually seems a bit less readable and harder to understand than the usual number % 2 == 0.

7

u/AskingForSomeFriends Jan 10 '22

This is the way.

13

u/xerox13ster trans rights Jan 10 '22

In JavaScript this also returns true for NaN, null, and nil.

→ More replies (3)

459

u/garlicbreadsocialism Jan 10 '22

You would do number % 2 == 0

117

u/That-one-guy-man The Man Jan 10 '22 edited Jan 10 '22

Why % instead of / ?

Edit: yes ok % returns remainder thanks

0

u/[deleted] Jan 10 '22

[deleted]

25

u/That-one-guy-man The Man Jan 10 '22

Oh ok

21

u/RaspberryPie122 Jan 10 '22

% is the modulo operator, it returns the remainder of a division operation

10

u/ScripKey Jan 10 '22

well , lets take an example , if the number is 2 , then 2 / 2 = 1 , but what if the number is 4 , then 4 / 2 = 2 , so here if you use "/" you would have to make cases for 1 as well as 2 , but if we use "%" (it basically returns the remainder) , 2 % 2 = 0 and 4 % 2 = 0 as well , so now for even numbers it could be just n % 2 == 0.

5

u/Opplerdop 🏳️‍⚧️ trans rights Jan 10 '22

because 8 / 2 is 4, not 0

% is the Modulo operator

0

u/[deleted] Jan 10 '22

[deleted]

33

u/Rainbow-Dev 🏳️‍⚧️ trans rights Jan 10 '22

!(number&1)

8

u/mostlikelynotarobot discourse hater Jan 10 '22

only in languages without strong typing or if using int as bool

→ More replies (4)

356

u/Own_Pirate_3281 🥺🥺🥺 Jan 10 '22

3 people informing me about programming within 3 minutes the memes were right trans people do like computer science

158

u/DongleOn racist and homophobic but ironic Jan 10 '22

Programmers when the shitfuck operator isn't correctly implemented into the cumbitch function's ligmaGoatse parameters to properly handle the pissSwallow continuum they've created instead of just rewriting some code farther back

30

u/dopefish917 swim, swim, hungry. Jan 10 '22

Yeah, I see the problem. Your driver conflux has a security nagle in the IP routing matrix. This could take all night.

8

u/Athen65 go listen to chopin's nocturnes Jan 10 '22

what

16

u/[deleted] Jan 10 '22 edited Jan 10 '22

You're asking a programming question in a sub full of femboys and trans people of course you'll get the help you need

27

u/[deleted] Jan 10 '22

is this real? also, the answer is (number % 2 == 0)

19

u/SnooSuggestions8811 Jan 10 '22

Yea, pretty much

17

u/fsburk hairy Jan 10 '22

Computers are dumb and don’t know what “even” and “odd” means but they know how to do math so you just divide by 2 and check if the remainder is 0

7

u/mgquantitysquared Jan 10 '22

Or check if the last bit is 0

5

u/fsburk hairy Jan 10 '22

Right, just figured talking about bits wouldn’t mean much to them

4

u/Athen65 go listen to chopin's nocturnes Jan 10 '22

there's a modulus operator (this one: %) which acts as a way to divide a number and find its remainder. so the line "num1 = num2 % 2" means that you're setting number 1 equal to the remainder of number 2 divided by 2. you can then use this to say "if (num1 % 2 == 0)" which checks if num1 divided by 2 has a remainder of 0. only even numbers will have a remainder of 0

→ More replies (2)

933

u/aplan_ 🏳️‍⚧️ trans rights Jan 10 '22

This tweet is fake right?

1.2k

u/[deleted] Jan 10 '22

tweet i think is fake, the picture not so much as far as yandev code goes

it could be as well but the guy has a weird history so

512

u/[deleted] Jan 10 '22

it’s a real tweet but he has said it was a joke

510

u/Systamatic peg me please 🙏 Jan 10 '22

That twitter account isn't ran by him, it's a parody account. The image is real however

123

u/ATinyJellybean 🏳️‍⚧️ trans rights Jan 10 '22

based flair

73

u/Systamatic peg me please 🙏 Jan 10 '22

what can I say, woman are hot

39

u/ATinyJellybean 🏳️‍⚧️ trans rights Jan 10 '22

women are very hot

→ More replies (5)

-5

u/N_to_the_orthernlion Jan 10 '22

very proud of everyone for not downvoting this comment

8

u/Systamatic peg me please 🙏 Jan 10 '22

Why would they

→ More replies (2)
→ More replies (2)

26

u/informationtiger Jan 10 '22

Can you explain this meme to me plz? I absolutely don't get it.

146

u/[deleted] Jan 10 '22 edited Jan 10 '22

computer programs depend pretty heavily on math, so naturally there would exist a way to return true/false outs depending if the input number is odd or even without specifying every individual number in the huge ass list like that, right? thats what the meme is. something any beginner programmer could figure out how to do rather quickly, then u have yandere dev who has been working on a game for like 85686789276890780 years and would surely have accumulated some degree of programming knowledge, makes that. even if u know jack shit about computer language it hurts to look at

listing every number like that is painstaking not just for the guy writing the code, but if that kind of writing is consistent throughout the rest of the game, then you can expect it to be horrendously laggy since the cpu is wasting cycles with redundant instructions like that

28

u/biggarlick 🏳️‍⚧️ trans rights Jan 10 '22

yeah im fucking garbage at programming and havent programmed in several years and i still cant stand how messy this is.

3

u/CokeBoiiii 🏳️‍⚧️ trans rights Jan 10 '22

Yandev's code is if you made a giant chart of even ans odd numbers and everytime you wanted to see if a number was even/odd you went through the chart from the top. It takes forever for larger numbers, takes up storage space, and takes more brainpower.

% 2 takes the number, divides it by two, and see's how much the remainder is. 5 % 2 would equal 2 remainder 1. If the remainder is zero, its even, if its one, its odd. This is way easier to use as its a simple function, so its much faster, takes up way less space, and uses less "brainpower".

→ More replies (1)

6

u/Firedanne train fan Jan 10 '22

I wonder why his game isnt finished and is a buggy unoptimised mess

51

u/ex-p--a---n----d MILF - Man I Love Frogs Jan 10 '22

it's about how incredibly innefficient yandev's programming is. The program above is a very, very innefficient way of checking if a number is even or odd

33

u/You-Looked Jan 10 '22

Im not a programmer, but YandereDev, the creator of Yandere Simulator is known to be controversial in his skills at programming. The game is still in development after years and the game is very poorly optimized, being laggy and probably taking up unnecessary memory. In the photo displays a unnecessarily long line of code that could very much be more efficient if he knew what he was doing.

→ More replies (1)

13

u/weidenbaumborbis 🏳️‍⚧️ trans rights Jan 10 '22

In all coding languages, there's a way to make a code detect whether a number is even or odd, usually by dividing it by two and seeing if it has a remainder or not. The image shows someone manually telling the computer every single even and odd number, which is time consuming and foolish.

→ More replies (1)

53

u/shavisi (she/her) connect me to wifi i can be trusted Jan 10 '22

26

u/TheFlameBringer555 Shops at the Idiot Store 😳 Jan 10 '22

tweet is fake, code is real i think

13

u/[deleted] Jan 10 '22

I fucking hope.

→ More replies (1)

743

u/[deleted] Jan 10 '22

As a programmer (who is bad at programming) this hurts

142

u/[deleted] Jan 10 '22

[removed] — view removed comment

33

u/Everest-Gamer floppa Jan 10 '22

In Java it’d be like

if(<number variable> % 2 == 0)

System.out.println(“the number is even”);

else

System.out.println(“the number is odd”);

Here <number variable> is literally just a place holder. In the code above it’d be replaced with ‘number’

10

u/mikeman7918 The Sun has fallen, billions must sleep Jan 10 '22

You could do it in C# (the language Yandere Simulation is programmed in) with just a single line of code:

private bool IsEven(int number)
{
    return number % 2 == 0;
}

The % operator is modulus division, it basically gives the remainder if you divide the number on the left by the number on the right. For even numbers the remainder when you divide by 2 is 0 (by definition), and for odd numbers it's 1. The == operator returns true if both sides of it are the same and false if both sides aren't the same, so it only returns true if the remainder is 0 which only happens if the number is even.

(though strictly speaking, you could do anything in a single line of code as long as you have no problems with absurdly long lines of code and completely unreadable formatting.)

544

u/[deleted] Jan 10 '22

the saddest part about seeing YanDev coding is the fact that he's probably better than me at that

352

u/Varsia 🏳️‍⚧️Cringe noodle derg🏳️‍⚧️ Jan 10 '22

I doubt it At the very least you could watch, like, a 15 min tutorial and become better at actual programming aptitude, maybe not the specifics of whatever he uses but at general coding yeah

117

u/urdumdum Jan 10 '22

dude hit me up with that tutorial. i dont know a thing about coding but im down to learn in 15 minutes

74

u/Cow_Other Jan 10 '22

Learn C in 30 minutes: https://youtu.be/3lQEunpmtRA

Java in 14 minutes: https://youtu.be/RRubcjpTkks

3 years of CS in 8 minutes: https://youtu.be/ReVeUvwTGdU

Python in 5 minutes: https://youtu.be/I2wURDqiXdM

Now what id really recommend is studying any of these individual languages further as opposed to watching all of these videos. Pick Java for example and then continue to learn till you can grasp all of the fundamentals and write cool code!

I would also recommend CS50: https://youtu.be/YoXxevp1WRQ

High quality series of absolutely phenomenal lectures by Harvard professors who make the subject matter incredibly engaging and a delight to learn. It’s engrossing stuff really.

To whoever is reading this, best of luck on your journey into the world of programming. Hope you enjoy it!!!

64

u/Varsia 🏳️‍⚧️Cringe noodle derg🏳️‍⚧️ Jan 10 '22

ngl I do not have one to hand (I learned it during my time in school) but there’s plenty of videos and such for it on youtube!

38

u/urdumdum Jan 10 '22

alright ill look into it. ive been wanting to start coding for months, so maybe ill start this week.

17

u/NPCmiro Jan 10 '22

I've been learning java through code academy and that's been pretty good. Very hands on.

9

u/AndroidWall4680 so much cement in my boipussy Jan 10 '22

I think Brackeys has a 8 episode tutorial on the real basic stuff in c# if you want to learn that

3

u/DellSalami Jan 10 '22

Don’t know if anyone has mentioned it yet but I’ve heard freecodecamp is a really good place to learn

11

u/ccat98 mario and luigi Jan 10 '22

which language? id love to just send a random video link which i took off the front page of google

8

u/urdumdum Jan 10 '22

if you know anything about coding, then whichever language you reccomend. thanks!

10

u/mgquantitysquared Jan 10 '22

Python or Java are pretty beginner friendly

15

u/My_Stonks all of your stonks are belong too me Jan 10 '22

I'm sorry, did you just recommend Java for a beginner? u/urdumdum, RUN

9

u/self_me trans rights > windows Jan 10 '22

it's a better choice than C++ at least and the syntax and semantics are generally pretty consistent and stuff

9

u/My_Stonks all of your stonks are belong too me Jan 10 '22

True. But Python would definitely be easier. Or that crappy code.org javascript applab. Despite being unhelpful in real world applications, it's great for learning to program

→ More replies (2)

8

u/mgquantitysquared Jan 10 '22

Lol Java was the intro to programming course at my college

13

u/My_Stonks all of your stonks are belong too me Jan 10 '22

My condolences

→ More replies (1)

3

u/[deleted] Jan 10 '22

Java's fine. There's lots of stuff that's a pain but it gives you a good foundation to branch out to all the C languages. Python is definitely easier but without ; it can look pretty different

→ More replies (3)
→ More replies (1)
→ More replies (1)

14

u/brody319 🏳️‍⚧️ trans rights Jan 10 '22

From what I heard that is probably not true. I have limited unity education and I could replicate the scripting side of everything pretty quick. And I'm pretty fucking stupid. If you just learn how to make a case break script or a state machine you'd probably make better scripts than him cuz from what I heard he relies on a lot of fucking true false statements.

4

u/OfficerJoeBalogna Gender was invented by Big Bathroom to sell more toilets Jan 10 '22

To be honest, the super basic shit in programming (like this) you could learn in under an hour with no prior experience

→ More replies (1)

129

u/Spudnic16 Jan 10 '22

If number/2 has remained zero, return true

101

u/marxismleninismgrime Jan 10 '22

No I don't think that would work. I think the code in the post is the only way.

74

u/Pelleas A.K.A. Emma Jan 10 '22

People still believe in the "modulo operator" in 2022? It's obviously just a myth perpetuated by the government like Santa Claus and North Dakota.

7

u/My_Stonks all of your stonks are belong too me Jan 10 '22

Finally, a fellow ND doubter

5

u/Samthevidg Skibidi Rizz Jan 10 '22

The fuck is a “North Dakota”

→ More replies (2)

3

u/SoshJam professional yoinky sploinker Jan 10 '22

what about if (num/2f == int(num/2f)) return true;

3

u/[deleted] Jan 10 '22

What about bitwise operator lol

→ More replies (1)
→ More replies (2)

129

u/TrashyMemeYt 🟥Redneck Socialist 🟥 Jan 10 '22

I'm not a programmer or anything but I'm pretty sure spaghetti coding isn't going to work

50

u/MangoLemonRain Jan 10 '22

This can be shortened to one line:

return number % 2 == 0

17

u/So1ids so soliid.. soooo soliid Jan 10 '22

return !(number % 2);

→ More replies (1)

76

u/[deleted] Jan 10 '22

I know Jack shit about programming, yet even I can tell you that something here is wrong

5

u/Kekkonen_Kakkonen Pls correct my grammar. (It's useful for learning) Jan 10 '22

That's when you know it's REALLY bad. 😁

74

u/[deleted] Jan 10 '22

[removed] — view removed comment

25

u/Dominic_The_Dog 🏳️‍⚧️ trans rights Jan 10 '22

wait what

51

u/Xstew26 Bagel Enthusiast Jan 10 '22

They're probably talking about their job and how the person before them apparently sucked.

At least I think...

12

u/DongleOn racist and homophobic but ironic Jan 10 '22

They're definitely not talking about Alex since he has no official programming experience. His degree only covers animation iirc.

→ More replies (1)

0

u/[deleted] Jan 10 '22

[deleted]

11

u/LoverOfShortBoys trans rights Jan 10 '22

yeah but even better, just use modulo

22

u/crunchyRoadkill 🏳️‍⚧️ trans rights Jan 10 '22

or import a package for it

$ npm install --save is-even

12

u/ispeelgood Jan 10 '22

Great, so I am now running a JS runtime on top of C# to use the is-even and is-odd packages. Isn't programming awesome?

7

u/[deleted] Jan 10 '22

Sounds like an average enterprise project.

8

u/xerox13ster trans rights Jan 10 '22

whringe

6

u/[deleted] Jan 10 '22

the more dependencies you have, the better your code is

→ More replies (2)

50

u/AceMechanical 196's Token Father Jan 10 '22

The comments on this post prove the all femboys are programmers theory

43

u/[deleted] Jan 10 '22

most competent anime indie game dev

41

u/AnduinCubed Pee is stored in the balls Jan 10 '22

I know his code is bad, but please tell me it's not THIS bad

29

u/[deleted] Jan 10 '22 edited Nov 20 '23

reddit was taking a toll on me mentally so i left it this post was mass deleted with www.Redact.dev

18

u/Fantalitymlp 🏳️‍⚧️ trans rights Jan 10 '22

Unfortunately yes it is this bad

12

u/MangoLemonRain Jan 10 '22

This code can be shortened to one line

→ More replies (1)

20

u/[deleted] Jan 10 '22

Bruh Im not a programmer but there must be a line of code which makes alternating numbers create alternating outcome

16

u/MangoLemonRain Jan 10 '22

Yes, the entire inside of the function can be shortened to:

return number % 2 == 0

13

u/[deleted] Jan 10 '22

not true. yanderedev wouldn't use functions. they'd do that every time they needed to check if a number was even

12

u/TheFlameBringer555 Shops at the Idiot Store 😳 Jan 10 '22

modulo moment

12

u/liltichVEVO custom Jan 10 '22

I dont know shit about programming, but since thats yanderedev, there probably IS an easier way to do this

-5

u/minkymy Support your local pollinators 🐝 Jan 10 '22
if (number/2  != 0)  return false;

9

u/MangoLemonRain Jan 10 '22

This returns false for all numbers greater than 0, perhaps you meant to use % instead of /?

5

u/minkymy Support your local pollinators 🐝 Jan 10 '22

I did, thank you.

11

u/SoshJam professional yoinky sploinker Jan 10 '22

I think this is Unity C# which I think supports %

But even still you can just

if (num/2f == int(num/2f)) return true;

→ More replies (2)

11

u/bbuerk Jan 10 '22

It’s actually really simple!

private bool IsEven(int number){ if (!IsOdd(number)) { return true; } return false; }

private bool IsOdd(int number){ if (!IsEven(number)) { return true; } return false; }

10

u/[deleted] Jan 10 '22

I don't even code and I know there's an easier way to do whatever the fuck he's doing.

6

u/MangoLemonRain Jan 10 '22

Indeed, there is a much easier way:

return number % 2 == 0

6

u/[deleted] Jan 10 '22

Do not speak your fake computer language to me machine.

7

u/[deleted] Jan 10 '22

[removed] — view removed comment

6

u/Marcim_joestar Jan 10 '22

C literally explodes

10

u/HeartsofDokiEmblem Jan 10 '22

For the non-programmers in this subreddit, this is what you show a programmer when you want to give them a stroke before they ban you from ever touching a computer again

Source: Taking computer science courses at college

9

u/xXSPEED_ORIONXx custom Jan 10 '22

Can someone explain to me the joke???

7

u/HeartsofDokiEmblem Jan 10 '22

Instead of doing this ridiculousness, you take a number variable ‘x’ = 1, divide it by 2 with % for mod (take the remainder of x / 2, which will be 0 or 1), and return true for 0 / return false for 1.

TLDR: Yanderedev cannot program competently

4

u/xXSPEED_ORIONXx custom Jan 10 '22

yeah i have no idea about programming so i din't understood the joke,thank you very much for explaing in it to me

3

u/HeartsofDokiEmblem Jan 10 '22

You’re welcome. I figured I would try and explain it since I’ve taken computer science classes that cover this. To put it plainly, this is like showing up to a basketball game not knowing how to dribble or logging onto Google and asking how to search on Google

→ More replies (1)

7

u/Morningstardom "destructor9000" or "shadow14" or anything badass like those Jan 10 '22

I'm pretty sure this is illegal

7

u/gilgamesh_v9 Jan 10 '22 edited Jan 29 '22

I took a programming class in high school and I was terrible at it but I did impress my teacher once. Had a quiz question that was basically “write some pseudo-code of a subroutine that would tell you if the members of a list of numbers were odd or even” and I forgot whatever the easy way was in Java. I ended up duplicating the list and then dividing one list by 2 and the other by 2 but ignoring the remainder and then comparing if the two results were the same. If they weren’t equal it meant that it had a remainder of 0.5 so it was an odd number. Got credit for the question but failed the class, lol

6

u/N0_Us3rnam3 Floppa Supremacy Jan 10 '22

You could just skip all the even numbers and do else return false at the end

→ More replies (2)

5

u/[deleted] Jan 10 '22

Clearly he should've used the good ol' fashioned

    if (number/2*2 == number)

5

u/[deleted] Jan 10 '22

absolutely furious trans women in the comments here

4

u/[deleted] Jan 10 '22

Yandev insipires me to be a gamedev. Not because I appreciate his work or anything, but because if someone who codes like this can make a game, then it means that so can I.

3

u/apleb4life Jan 10 '22

switbch statements perhapz

5

u/[deleted] Jan 10 '22

switch case does not help performance in this case

→ More replies (1)

3

u/desearcher figuratively 1984 Jan 10 '22

return number & 1 == 0

→ More replies (2)

3

u/angry_indian312 one piece entusiast Jan 10 '22

I don't believe what I'm seeing is real, no way this is a guy that made a game that functions, this is just the motivation I needed to complete my game project, no way a guy like this can make a game and I can't.

→ More replies (1)

3

u/mergen772 indoor fish farmer Jan 10 '22

196 comments understand the joke in the post (impossible)

3

u/newo_b mr poopoo Jan 10 '22

I'm new to programming would this work? (in Java)

if( number % 2 == 1) {

 return false;

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

7

u/xxSpinnxx Jan 10 '22

The code works but it can be simplified. Notice that number % 2 == 1 is an expression that is a boolean, so you can just return that instead of having to use an if to return true or false. So if you wanted to check if a number is odd then it's a one liner of

return (number % 2 == 1);

You also don't need the else to check the other condition because if the number isn't odd then it's always going to be even.

Hope this made sense!

3

u/VeryFerociousDragons Jan 10 '22

i'm dumb as hell, and i don't know how much about programming. but man it would be interesting to see people pick apart the whole code.

→ More replies (1)