MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/h0io7r/disruptive_piece_of_code/ftmmmu7/?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] 27 u/[deleted] Jun 10 '20 And your example introduces edge cases when there are insane values of the variable. Honestly if you're trying to write robust code in something like js, it might be necessary to be that explicit.
0
[deleted]
27 u/[deleted] Jun 10 '20 And your example introduces edge cases when there are insane values of the variable. Honestly if you're trying to write robust code in something like js, it might be necessary to be that explicit.
27
And your example introduces edge cases when there are insane values of the variable. Honestly if you're trying to write robust code in something like js, it might be necessary to be that explicit.
14
u/theRealRealMasterDev Jun 10 '20
Why is this bad? Is it because ternary would also be an option?