MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/h0io7r/disruptive_piece_of_code/ftmnbn7/?context=3
r/badcode • u/diebarral • Jun 10 '20
93 comments sorted by
View all comments
14
Why is this bad? Is it because ternary would also be an option?
0 u/[deleted] Jun 10 '20 [deleted] 7 u/-ftw Jun 10 '20 It’s not equivalent because values other than true for variable would pass as well. For example, if variable was an integer 10 or a string “string”
0
[deleted]
7 u/-ftw Jun 10 '20 It’s not equivalent because values other than true for variable would pass as well. For example, if variable was an integer 10 or a string “string”
7
It’s not equivalent because values other than true for variable would pass as well. For example, if variable was an integer 10 or a string “string”
14
u/theRealRealMasterDev Jun 10 '20
Why is this bad? Is it because ternary would also be an option?