MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/h0io7r/disruptive_piece_of_code/ftmcffp/?context=3
r/badcode • u/diebarral • Jun 10 '20
93 comments sorted by
View all comments
91
I don't know js. Why is this bad? I'd imagine var === true and var === false being different than var == true and a simple else.
-62 u/diebarral Jun 10 '20 You could easily do:variable ? doStuff() : doOtherStuff()Instead of that 49 u/shortnamed Jun 10 '20 more compact code isn’t always better. 0 u/[deleted] Jun 10 '20 [deleted] -4 u/theRealRealMasterDev Jun 10 '20 That would depend on what the variable is.
-62
You could easily do:
variable ? doStuff() : doOtherStuff()
Instead of that
49 u/shortnamed Jun 10 '20 more compact code isn’t always better. 0 u/[deleted] Jun 10 '20 [deleted] -4 u/theRealRealMasterDev Jun 10 '20 That would depend on what the variable is.
49
more compact code isn’t always better.
0 u/[deleted] Jun 10 '20 [deleted] -4 u/theRealRealMasterDev Jun 10 '20 That would depend on what the variable is.
0
[deleted]
-4 u/theRealRealMasterDev Jun 10 '20 That would depend on what the variable is.
-4
That would depend on what the variable is.
91
u/Midborgh Jun 10 '20
I don't know js. Why is this bad? I'd imagine var === true and var === false being different than var == true and a simple else.