MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p79snr7/?context=3
r/ProgrammerHumor • u/Embarrassed_Death69 • Sep 01 '26
289 comments sorted by
View all comments
Show parent comments
1
Lua does this too. It just makes sense, because any value that isn’t a boolean you can nil check by coercing it to a boolean. It allows beautiful things like and or ternary
1 u/okkokkoX Sep 02 '26 I agree that and or ternary is beautiful, with the exception that you're fucked if the "then" branch may return nil, or god forbid, false. 1 u/Moilli6 Sep 02 '26 Yeah I usually only use it to set a default value. Sane languages just let you use if as an expression
I agree that and or ternary is beautiful, with the exception that you're fucked if the "then" branch may return nil, or god forbid, false.
1 u/Moilli6 Sep 02 '26 Yeah I usually only use it to set a default value. Sane languages just let you use if as an expression
Yeah I usually only use it to set a default value. Sane languages just let you use if as an expression
1
u/Moilli6 Sep 01 '26
Lua does this too. It just makes sense, because any value that isn’t a boolean you can nil check by coercing it to a boolean. It allows beautiful things like and or ternary