Small Proposal "!in"

T.J. Crowder tj.crowder at farsightsoftware.com
Wed Jul 11 17:51:12 UTC 2018


On Wed, Jul 11, 2018 at 4:51 PM, Alex Vincent <ajvincent at gmail.com> wrote:
> In Linux programming, #!/bin/bash is very commonly the first line of a
shell
> script. In Python, we have #!/bin/python, or #!/bin/perl.  The #!
characters
> are pronounced "she-bang", because # is pronounced "hash" and ! is
> pronounced "bang".

Indeed. But in JavaScript (and Java and C and C# and...), `!` is "not", and
I for one read it that way when reading anything other than bash script. I
don't read `!==` as "bang equal," either. (Which in British English would
be really misleading...)

And that's why I like the idea of `!in` (or `notin`), because I'd much
rather read and write "if property not in object" than "if not property in
object" (and don't get me started on the parens required to make it work
:-) ).

To me, `!in` or `notin` or whatever you want makes perfect sense, just like
we have `!=` and `!==`. It's like not having `!==` and then arguing we
don't need to have it because after all, you can write `n != 1` as `!(n ==
1)`.

Heck, all we really need is NAND gates, right? ;-)

On Wed, Jul 11, 2018 at 6:33 PM, Isiah Meadows <isiahmeadows at gmail.com>
wrote:
> So I agree this is a Really Bad Idea™, for this above if not the Kotlin
> reference.

I strongly disagree it's a Really Bad Idea™. I think it's a Moderately Good
Idea On The Whole™. And `!in` is fine by me but I'm also happy with `notin`
or whatever.

I just don't expect it to happen. Too much inertia to add it
after-the-fact, and too many bigger fish to fry. :-)

-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180711/375f33f7/attachment.html>


More information about the es-discuss mailing list