YandereDev is the online handle of Alexander Mahan, the developer of the stealth-action video game Yandere Simulator. Online, many have criticized Mahan's coding skills as subpar and his work schedule as inconsistent, a combination of which has lead to the game being in development for over six years with no estimated date of release. This has resulted in YandereDev being antagonized by a large part of the Yandere Simulator community and him becoming a subject of memes and mockery.
The game's code ran COMICAL Amount of if statements which contained a colossal amount of nested loops which ran every single frame making the game optimisation spaghetti clusterfuck.
So writing code with a insane amount of (largely useless or replaceable) if statements are met with the mockery of 'Yandere code', at first I was thinking to post this very reddit post with the title "Didn't know YandereDev did Python as well" Then later ditched it lol.
This is a new feature as of python 3.10 called structural pattern matching. You can read the PEP here but it's a different and significantly more powerful feature than a switch case which is why it uses a different keyword, rather than it being a "special snowflake" as you mentioned. I'd suggest having a look into it, it's a super cool feature :)
(Jokes aside, this is a super powerful and useful feature, way beyond regular switch statements... even if it's still called a switch statement in languages that have this feature)
Well you know copilot had to saw the code somewhere before. I would love it if people started to making horrible meme repositories of just the worst code possible to mess with copilot. Have it be like the Twitter bot who went full nazi.
Not necessarily if this is Python 2. input evaluates a Python expression in Python 2. 4 would resolve to an int. hello would raise a NameError unless the symbol hello is in scope, in which case it returns that value. "hello" would actually give you a string. os.system("/bin/sh") would give you an interactive shell if os is imported.
I've seen an experienced programmer manually convert decimal representation of numbers to hexadecimal (as long as they have less than 3 digits), so nothing would surprise me at this point.
The beautiful thing is that none of those ifs will ever be executed because number is already a string, but the programmer will see the output they want and assume it worked perfectly.
number = input("> ")
if number == 0:
number = "0"
if number == 1:
number = "1"
if number == 2:
number = "2"
if number == 3:
number = "3"
if number == 4:
number = "4"
if number == 5:
number = "5"
if number == 6:
number = "6"
if number == 7:
number = "7"
if number == 8:
number = "8"
if number == 9:
number = "9"
if number == 10:
number = "10"
if number == 11:
number = "11"
if number == 12:
number = "12"
if number == 13:
number = "13"
if number == 14:
number = "14"
if number == 15:
number = "15"
if number == 16:
number = "16"
if number == 17:
number = "17"
print(‘number = input(“>”)’)
for i in range(17):
print(“if number == “ + str(i))
print(‘\t number = “‘ +str(i) +’”\n’)
If I’m write abt the single/double quotes, else you may need the backslash for the doubles. You know it’s bad when you can write 4 lines of code to generate like 60 lines of code, lol
112
u/[deleted] Oct 27 '21
That's terrible programming.
You should just use a switch case
222
u/silkyAnalShitter Oct 27 '21
Bro inputs are already a string
106
u/InsanityAI Oct 27 '21
Did the copilot write this? https://www.reddit.com/r/ProgrammerHumor/comments/qfzpes/github_copilot_the_technology_that_will_replace/?utm_medium=android_app&utm_source=share
64
u/Xeonmeister Oct 27 '21
TODO: add more numbers
62
u/SoulslikePursuer Oct 27 '21
Let me guess:
If number == 18: number = "18"
¿
24
u/twoPoundsOfGoldfish Oct 27 '21
funniest part is that input() already returns a string
19
u/TheDiscoJew Oct 27 '21
I'm convinced that a lot of these posts with a 20+ long else-if chain are just karma bait. I have never even seen someone do this irl.
10
u/-MazeMaker- Oct 27 '21
The beautiful thing is that none of those
ifs will ever be executed becausenumberis already a string, but the programmer will see the output they want and assume it worked perfectly.9
u/Legendary-69420 Oct 27 '21
I think it is that GitHub Copilot generated snippet
8
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Oct 27 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
6
u/trutheality Oct 27 '21
No, no, this is terrible. It doesn't generalize to larger numbers. This does:
5
u/_grey_wall Oct 27 '21
Should've used a switch statement
/s
3
u/[deleted] Oct 27 '21
Uh that is one way to do it
3
u/PersonalBox0 Oct 27 '21
It's not even an 'if else' statement, so it will check All if statements even if one of them is true. Truly deplorable.
3
u/Crayfishpdx Oct 27 '21
Should be
Number = int(input(“> ”))
There we go, now it’s perfect. Lol
2
u/banana_person Oct 27 '21
Why are you not using enum smh
2
u/Taldoesgarbage Oct 28 '21
my god it's wrong in so many ways
2
u/luijika101 Oct 29 '21
Oh no this is bad bad
1
u/MikeSemicolonD Oct 27 '21
Nothing like posting copilot snippets! The new r/badcode content generator! What a time to be alive.
1
u/_Sherlock-Holmes_ Oct 27 '21
blasphemy
-1
u/[deleted] Oct 27 '21
B-b-but why?