this post was submitted on 01 Jul 2023
70 points (97.3% liked)

Programming Humor

2761 readers
1 users here now

Related Communities [email protected] [email protected] [email protected] [email protected]

Other Programming Communities [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

founded 2 years ago
MODERATORS
 

If only string maps were known to human kind :)

top 7 comments
sorted by: hot top controversial new old
[–] WaveWood 17 points 2 years ago

Clearly the issue is that they are using switch cases instead of if statements /s

[–] bwrsandman 10 points 2 years ago

Maps? Could get away with an array!

[–] Kojak747 4 points 2 years ago

For shame, I recently did something like this, but only because a/ I have been programming for 3 weeks and b/ told chat gpt to edit my code. Either way, we both failed. Use arrays people!

[–] Ignisnex 3 points 2 years ago

Case with numbers? I really want to change that to an enum or something lol.

[–] nbdy 3 points 2 years ago

How about a dict[int, str], which holds your case and newscript?

[–] MelodiousShark 2 points 2 years ago

Yes there is and, at least on reddit, you'd have people defending this code for no reason other than it works and the only bad code is code that doesn't work or something stupid like that.

[–] shotgun_crab 1 points 2 years ago

I love how they even copied the comment