[swift-evolution] Remove (!) logical negation operator

Rudolf Adamkovic salutis at me.com
Tue Dec 15 14:13:34 CST 2015


+1 for clean-up:

• "and" instead of && 
• "or" instead of ||
• "not" instead of !
• if expressions instead of ?!

Easier to read, easier to type, easier to understand for beginners.

As a bonus, it doesn't look like optionals (less !s and ?s).

R+

Sent from my iPhone

> On 15 Dec 2015, at 20:49, Sune Foldager via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On 15 Dec 2015, at 17:05, Tommy van der Vorst via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> I *do* see negative effects of removing it: ! is part of virtually all programming languages currently in use, any decent programmer is accustomed to it and read it like 'not' in their head anyway. Removing would definitely confuse newcomers to the language. 
> 
> I completely agree. While it *is* a bit weird to use the same symbol for forced unwrap and its more traditional use as boolean negation, removing the one virtually all other languages have is not the answer. If we do that, why not also ~ for binary negation, || and && and even + and -.
> 
> It’s always a balance between verbosity, “natural language”-ness and terseness. It’s not always easier to read code that’s very verbose, and I’m sure we don’t want Swift to be like AppleScript.
> 
> -Sune
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151215/bd2735bd/attachment.html>


More information about the swift-evolution mailing list