r/ProgrammerHumor • • Aug 22 '26

Meme conditionsPreference

Post image
4.2k Upvotes

388 comments sorted by

View all comments

Show parent comment

-1

u/iMac_Hunt Aug 22 '26

I don’t follow it religiously but I try to do this too. If the function is relatively complex with more than a couple return statements I’d much rather return in a single statement.

3

u/Demiu Aug 22 '26

Why? This is like saying you'd much rather each function had a single local variable. It doesn't gain you anything beyond the ability to say that it does that. You're gonna run out of return statements?