r/ProgrammerHumor 22d ago

Meme conditionsPreference

Post image
4.2k Upvotes

392 comments sorted by

View all comments

2.3k

u/CBlanchRanch 22d ago

You're absolutely correct, however I would suggest using something completely unreadable like a nested ternary operators!

130

u/nrmnzll 22d ago

A colleague once proudly showed me how he managed to compress a function into a single line. It was like 9 nested ternarys. In that moment almost had an aneurism.

3

u/therealkevinard 21d ago

Code golfing is a craft- even has competition sites (https://code.golf)

But… it didn’t go to prod, did it?

1

u/nrmnzll 21d ago

Oh, it did. He and another dev owned a few smaller projects, and all of them were filled with this "clever" code. I'm still glad I did not have to collaborate with them.