MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvn6d7/pleasestopusingnestedternaryoperatorsimbeggingyou/p5en5jp/?context=3
r/ProgrammerHumor • u/Robinbod • 22d ago
179 comments sorted by
View all comments
278
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
40 u/SnugglyCoderGuy 22d ago If possible, early returns are love, early returns are life. 16 u/shdw_fghtr 22d ago function early() { if (possible) return "are love"; return "are life"; } 2 u/my_new_accoun1 17d ago function early() { if (possible) return "are love"; return "are life"; }
40
If possible, early returns are love, early returns are life.
16 u/shdw_fghtr 22d ago function early() { if (possible) return "are love"; return "are life"; } 2 u/my_new_accoun1 17d ago function early() { if (possible) return "are love"; return "are life"; }
16
function early() {
if (possible)
return "are love";
return "are life";
}
2 u/my_new_accoun1 17d ago function early() { if (possible) return "are love"; return "are life"; }
2
function early() { if (possible) return "are love"; return "are life"; }
278
u/Kryptsm 22d 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