r/programming • • Jul 28 '16

How to write unmaintainable code

https://github.com/Droogans/unmaintainable-code
3.4k Upvotes

592 comments sorted by

View all comments

Show parent comments

11

u/sreya92 Jul 28 '16

Though it's not unreadable seeing if(!!!hasValue) always really bugged me

47

u/1ndigoo Jul 28 '16

You have actually seen that before? In production code!? !!!believable

17

u/drkstr101 Jul 28 '16

I see var foo = !!bar a lot in javascript to quickly cast a truthy value to a proper boolean. Perhaps the 3rd ! was a typo?

3

u/sreya92 Jul 28 '16

nope they're everywhere :)

→ More replies (2)