> Inherently no worse than 'if (!ptr)' or 'if (ptr && ptr->field)'.
to tug this back to plan 9, and to encourage new code to resemble old:
typically plan 9 code would have
if(ptr == nil)
if(ptr != nil && ptr->field)
[depending on what `field' was, there might even be a != 0].
we're far too stupid for clever tricks like !!x. we'd probably just write
tf = (x != 0);
assuming that's the correct translation (it's pre-espresso here), but it is
hardly ever needed anyway.
!! was probably introduced by people determined to show their perfect grasp
of the language (if not the science). in fact, in the linux kernel !! seems to
be used as an operator much less than it is used in excited comments and
exciting messages for the console.
DBG_PRINT(ERR_DBG,"%s:Dont know, can't say!!\n"
to my surprise there are several instances of that in the plan 9 kernel!! but
fortunately
none of them is serious, and all were added later!!!