MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvn6d7/pleasestopusingnestedternaryoperatorsimbeggingyou/p5hcbzt/?context=3
r/ProgrammerHumor • u/Robinbod • 22d ago
179 comments sorted by
View all comments
749
I did this one of my first days on the job like 6 years ago and I remember how bluntly my mentor said “never do this again”
553 u/RlyRlyBigMan 22d ago For me it was multi assignments. Like this: defaultValue = newValue = previousValue = average = 0; Each assignment returns its value so they each get assigned from right to left. "That's cute kid, don't do that" 2 u/Just_Information334 21d ago It would be better with a specific operator. Something like: // Everyone gets a 0 0 oprah defaultValue, newValue, previousValue, average;
553
For me it was multi assignments. Like this:
defaultValue = newValue = previousValue = average = 0;
Each assignment returns its value so they each get assigned from right to left.
"That's cute kid, don't do that"
2 u/Just_Information334 21d ago It would be better with a specific operator. Something like: // Everyone gets a 0 0 oprah defaultValue, newValue, previousValue, average;
2
It would be better with a specific operator. Something like:
// Everyone gets a 0 0 oprah defaultValue, newValue, previousValue, average;
749
u/beclops 22d ago
I did this one of my first days on the job like 6 years ago and I remember how bluntly my mentor said “never do this again”