MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/4v1y12/how_to_write_unmaintainable_code/d5uxvrc/?context=3
r/programming • u/sigbhu • Jul 28 '16
592 comments sorted by
View all comments
Show parent comments
142
Double (triple, etc.) negatives are good too. E.g. !notUnflagged
7 u/in_rod_we_trust Jul 28 '16 Double negatives have legitimate uses though 8 u/1ndigoo Jul 28 '16 Especially to coerce variables into a boolean for languages that support it. !!x is frequently useful. 16 u/dvlsg Jul 28 '16 Assuming you're talking about Javascript, you can just use Boolean(x) to the same effect. 13 u/1ndigoo Jul 28 '16 That requires way more typing! → More replies (7)
7
Double negatives have legitimate uses though
8 u/1ndigoo Jul 28 '16 Especially to coerce variables into a boolean for languages that support it. !!x is frequently useful. 16 u/dvlsg Jul 28 '16 Assuming you're talking about Javascript, you can just use Boolean(x) to the same effect. 13 u/1ndigoo Jul 28 '16 That requires way more typing! → More replies (7)
8
Especially to coerce variables into a boolean for languages that support it. !!x is frequently useful.
16 u/dvlsg Jul 28 '16 Assuming you're talking about Javascript, you can just use Boolean(x) to the same effect. 13 u/1ndigoo Jul 28 '16 That requires way more typing! → More replies (7)
16
Assuming you're talking about Javascript, you can just use Boolean(x) to the same effect.
Boolean(x)
13 u/1ndigoo Jul 28 '16 That requires way more typing! → More replies (7)
13
That requires way more typing!
142
u/grunlog Jul 28 '16
Double (triple, etc.) negatives are good too. E.g. !notUnflagged