4 ms·
I think familiarity is a key factor here, and I think your examples highlight that. !! seems slightly arcane to me, and I'd rather write some function like to_
by aninhumer 10y ago
I think familiarity is a key factor here, and I think your examples highlight that.
!! seems slightly arcane to me, and I'd rather write some function like to_bool() to make the intent clearer, but I imagine if you're used to it !! is immediately obvious, and to_bool() would be confusing because it's not !!. (And conversely, if to_bool was part of a standard library and widely used, !! would seem arcane.)
I don't think either technique has any real practical advantage, and the real trick is writing your code for the people who need to read it.