this post was submitted on 16 Nov 2023
196 points (95.8% liked)

Programmer Humor

25750 readers
1415 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 2 years 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 2 years 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 2 years ago

This, and maybe a couple of unit tests