<div dir="ltr">-1. In terms of C features that people complain about, prefix '!' for negation doesn't seem to be high on the list, and it's never something that has caused me or any other developer I know a problem (although these are all anecdotes, take them as you will). A linter/style checker can always be used if you really want to enforce 'x == false' over '!x' for your team or project.<div><br></div><div>'~' is already used for bitwise negation.<br><div><div><br></div><div>More broadly, in terms of "words" vs "cryptic symbols" as operators, I am strongly against the former and for the latter. The symbols are 'cryptic' for the few minutes it takes to figure out what they mean, after which the developer is good for a lifetime of coding in many different languages. The words are nicely self-descriptive for a bit, then increase verbosity and destroy your ability to visually delineate arguments via symbols forever.</div><div><br></div><div>Best,</div><div>Austin</div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 15, 2015 at 9:59 AM, ilya via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="white-space:pre-wrap"><span class="">> For example in `if let aBool = aBool where !aBool`, let's suppose that we know that `aBool` optional it's not empty before this check. How would you write it? `!aBool!` or with the `if let...` ?<br><br></span>if aBool == false {} covers this nicely. <br><br>As for the whole topic of words vs cryptic symbols for Boolean operators I'm agnostic on what's best but imho we need to have consistency. E.g. either all words, or all math symbols or all the same as in C (current state of things). <br><br>You can always rewrite !x as (x==false) if x is a Bool and forced unwrapping is undesirable anyway so the confusion can be minimized in practice. <br><br>Ilya. </div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Tue, Dec 15, 2015 at 19:56 Bruno Berisso via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">I also hit the <b>!=</b> vs <b><></b> dilema and conclude that we could continue using the <b>!=</b> as "not equal".<div><br><div>It's true that it will not be as consistent as before but I think it's a reasonable price to pay taking into account the issues with <b>!</b> as 'not'. </div></div><div class="gmail_quote"></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Not that I necessarily think this proposal is a good idea. The given examples reek of being against unwrapping for some reason.</div><div><br></div><div>Why not use `if let aBool = aBool where !aBool`? And `if let someValue = someValue where !(otherBoolValue && someValue > 0)`?</div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>I think the issue is the complete different meanings of a symbol depending only in where it appears in an expression. Adding that <b>!</b> character is really easy to miss in an expression make it at last uncomfortable.</div><div><br></div><div>I agree that we are all really used to find <b>!</b> in logical expressions and our brain is trained to translate it to NOT automatically but that doesn't mean that it's good idea to keep it there.</div><div><br></div><div>For example in `if let aBool = aBool where !aBool`, let's suppose that we know that `aBool` optional it's not empty before this check. How would you write it? `!aBool!` or with the `if let...` ?</div><div><br></div><div>I think that clearly <b>!</b> is not good choice for negation but my mind is so used to it that I can't totally affirm that <b>not</b> is <i>the</i> alternative to it. Do we have another alternatives?</div><div><br></div><div><br></div></div></div>
</div></div><span class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1p9Jer2O6jVE9KWvo-2B9iUaEyN8slp4IizyiLwsfp54PuIzNf98bk9mcnC9MK7FuAPQNbQF3aF2V9-2FQxdv0tdx7naNusXiMhFu3qrjivt3BLVtqWXFzZ1XAWEnCs1zO1TZLDPbZdBIf9TIa0mm3jX0MaVOjmGwLH1xMACTcDCvU3FwAFA4Pjpqa-2BzuaN-2BMKzlF8DNzNAlzIO4VGhbyz0Xrs3BBz1Mbida-2F5r-2FViPBAKg-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</span></blockquote></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=7XtDdMHRjqIUi4tzSjSp2pWQIyxYdP6woIWn4vwV5geIOhhDHxMMCUhvHPhaVWjPNeRHPSenv8r1esqoqbPEaSfHyMIe3SGKGNytJ8wy6T83l-2FxBDb7W8MmboUird6-2FVWyZLW24ySHlrl5ftEeIs04vweZ10rgMN5WbRSRqfIatjOa55a3n3c5eygu6R-2BTfc-2FDATUfZVVCJt5tfeecM1T-2FYHJDkBD93RJZdUNO2Nyek-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>