[swift-evolution] Proposal: remove "assert" and always use "precondition" instead.

sune.foldager at me.com sune.foldager at me.com
Mon Dec 14 17:34:17 CST 2015


> On 15 Dec 2015, at 00:13, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On Dec 14, 2015, at 6:09 PM, sune.foldager at me.com wrote:
>> 
>> I think precondition is a better name because it clearly expresses that this is an expected precondition for calling the method. Precondition is similar to Microsoft code contract’s Contract.Requires.
> 
> I want ALL my asserts to be active in release code. Correctness is more important than performance for me. I suspect this is also the case with most programmers.

I’m not so sure, but I don’t have strong feelings about that one. Precondition, however, should IMO remain as it is, observing Dave Abrahams’ arguments and my own above.

-Sune
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151215/1d9be8e9/attachment.html>


More information about the swift-evolution mailing list