this post was submitted on 16 Nov 2023
220 points (95.5% liked)

Programmer Humor

18292 readers
1292 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 

Yes, someone actually did this and I found it running on our server

you are viewing a single comment's thread
view the rest of the comments
[–] MagicShel@programming.dev 23 points 7 months ago (1 children)

I'd make it a named function for clarity and testability and proceed to give zero shits how it is implemented. I would unironically write this code if it worked, but I wouldn't inline it to reduce the cognitive load of reading it.

[–] Cosmicomical@kbin.social 2 points 7 months ago (1 children)

This, and maybe a couple of unit tests

[–] TheSlad@sh.itjust.works 4 points 7 months ago (1 children)

7 unit tests should be enough I think

[–] Cosmicomical@kbin.social 1 points 7 months ago

Lol i can't lie, it took me a while to get the joke. I feel so dumb