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

Adrian Kashivskyy adrian.kashivskyy at me.com
Tue Dec 8 17:59:23 CST 2015


That's a choice I would have to carefully make when designing the behavior. Not all asserts are non-recoverable.

Pozdrawiam – Regards,
Adrian Kashivskyy

> Wiadomość napisana przez Amir Michail <a.michail at me.com> w dniu 09.12.2015, o godz. 00:56:
> 
> 
>> On Dec 8, 2015, at 6:55 PM, Adrian Kashivskyy <adrian.kashivskyy at me.com <mailto:adrian.kashivskyy at me.com>> wrote:
>> 
>> Strong -1, `assert` is a great tool for catching programmer errors in development phase, without compromising the stability in release mode.
> 
> You would rather have an ill-defined state rather than a crash with a useful bug report?
> 
>> 
>> Pozdrawiam – Regards,
>> Adrian Kashivskyy
>> 
>>> Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> w dniu 09.12.2015, o godz. 00:52:
>>> 
>>> Swift is a safe language after all. Moreover, it is all too easy to accidentally type “assert” when you mean “precondition”.
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151209/07e0969b/attachment.html>


More information about the swift-evolution mailing list