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

Programmer Humor

19480 readers
203 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
[–] [email protected] 23 points 11 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.

[–] [email protected] 2 points 11 months ago (1 children)

This, and maybe a couple of unit tests

[–] [email protected] 4 points 11 months ago (1 children)

7 unit tests should be enough I think

[–] [email protected] 1 points 11 months ago

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