Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2008 16:05:21 +0300
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: RFC: small syscons and kbd patch
Message-ID:  <WUFHrI95zEo9/wlGGrRYnWztEtI@qm7gbYKMPO53E/nl%2BD5eD8YyL1A>
In-Reply-To: <7d6fde3d0812050050l57684eebkf14f252d78b68ec0@mail.gmail.com>
References:  <bb4a86c70812021701i621fdcfjb6a58a7f5cf781d5@mail.gmail.com> <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> <bb4a86c70812040724w43ddec15yab72920d80d879d3@mail.gmail.com> <20081205072229.GE18652@hoeg.nl> <7d6fde3d0812050034y43a70ce8i49fbba92f9c8943b@mail.gmail.com> <7d6fde3d0812050035u6e3ea930o9e093830a8608444@mail.gmail.com> <20081205084441.GA29312@owl.midgard.homeip.net> <7d6fde3d0812050050l57684eebkf14f252d78b68ec0@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--/e2eDi0V/xtL+Mc8
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 =3D=3D 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.
--=20
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual  =20
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook=20
    {_.-``-'         {_/            #

--/e2eDi0V/xtL+Mc8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkk5JxEACgkQthUKNsbL7YguFACgitCINYMboc3XROsVpHiqZXJS
lGoAn1wsMu62iIqyfyBJ1GbtFln1sISV
=mxfg
-----END PGP SIGNATURE-----

--/e2eDi0V/xtL+Mc8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?WUFHrI95zEo9/wlGGrRYnWztEtI>