Garret, Fri, Dec 05, 2008 at 12:50:38AM -0800, Garrett Cooper wrote: > 1. What dialect of C was it defined in? Is it still used in the > standard dialect (honestly, this is the first time I've ever seen it > before, but then again I am a younger generation user)?
It is the standard negation operator: !(expr) is equal to (expr == 0).
> 2. Is it still taught in schools (I didn't learn it when I was taught
> C)?
Yes. I am personally teaching the people in school and I am explaining
the concept of double negation every two years ;))
> If not in schools, what about the Richie text (it's sort of like
> the defacto C programming standard book of course)?
K&R book is good but it at no means covers all tricks and idioms
of a C language.
> 3. What's the real loss of going to `? :', beyond maybe 3 extra
> keystrokes if it's easier for folks who may not be as experienced to
> read?
No real loss, just easier to type and looks more compact. It is the
matter of a personal taste, I think.
If one knows this idiom, he will recognize it at a glance. If not, one
should think a bit about the logics behind it, but it shouldn't be hard:
almost everyone uses constructs like 'if (!ptr)'. And there is only one
step from there to the double negation.
--
Eygene
_ ___ _.--. #
\`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard
/ ' ` , __.--' # to read the on-line manual
)/' _/ \ `-_, / # while single-stepping the kernel.
`-'" `"\_ ,_.-;_.-\_ ', fsc/as #
_.-'_./ {_.' ; / # -- FreeBSD Developers handbook
{_.-``-' {_/ #
pgpsI9cudOk9G.pgp
Description: PGP signature

