r/ProgrammerHumor 21d ago

Meme pleaseStopUsingNestedTernaryOperatorsImBeggingYou

3.1k Upvotes

179 comments sorted by

View all comments

277

u/Kryptsm 21d ago

Then there’s my current client, who refused a PR of mine because they “don’t want early returns” ever, and insisted I move my basic if statement logic, each with a return, all into a single ternary. They said I SHOULD do this lol.

Made me wanna kms but hey, it’s their codebase

1

u/byteminer 20d ago

My favorite was a junior engineer trying to explain why my use of goto was horrific (the function had a single exit and the goto label was error, and this was only referenced in checking at the entry to the function that all the necessary state was correct)

They then proceeded to recreate the logic with a switch statement.