<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div style="font-family:Arial;">As much as I favor Swift's preference for API contracts, "I would just write the code differently," is missing the point of this suggestion.<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">You can design a single function to look beautiful without any unwraps, but in a system or a codebase, you must check those preconditions at some point. If you are dealing with other paradigms that you can't control, like Cocoa two-stage loading, you must check those preconditions at some point.<br></div>
<div style="font-family:Arial;"><br></div>
<div id="sig20055365"><div class="signature"><span class="font" style="font-family:arial, sans-serif, sans-serif">Zach Waldowski</span><br></div>
<div class="signature"><a href="mailto:zach@waldowski.me"><span class="font" style="font-family:arial, sans-serif, sans-serif">zach@waldowski.me</span></a><span class="font" style="font-family:arial, sans-serif, sans-serif"></span><br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">On Thu, Jun 29, 2017, at 01:43 PM, ilya via swift-evolution wrote:<br></div>
</div>
<blockquote type="cite"><div dir="ltr"><div style="font-family:Arial;">I'm not sure those examples are what we should aim for. Generally I try to avoid force unwrapping, and specifically in these cases I belive a more reliable code would be produced without either ! or the !! operators:<br></div>
<div><br></div>
<div><a href="https://gist.github.com/ilyannn/4c5530c75293db0324a04f50ae691b2a">https://gist.github.com/ilyannn/4c5530c75293db0324a04f50ae691b2a</a><br></div>
<div><br></div>
<div>I understand coding styles may differ, but I do worry that we "promote" force unwrapping too much&nbsp;by inroducing another operator for it.<br></div>
<div><br></div>
<div>Ilya.<br></div>
<div><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;"><br></div>
<div defang_data-gmailquote="yes"><div dir="ltr">On Thu, Jun 29, 2017 at 6:55 PM Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div style="word-wrap:break-word;"><div style="font-family:Arial;"><br></div>
<div><blockquote type="cite"><div>On Jun 29, 2017, at 9:13 AM, Dave DeLong &lt;<a href="mailto:delong@apple.com">delong@apple.com</a>&gt; wrote:<br></div>
<div><div style="font-family:Palatino-Roman;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><br></div>
<div style="font-family:Palatino-Roman;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">My usage of “!!” generally falls in to two big buckets:<br></div>
<div style="font-family:Palatino-Roman;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><br></div>
</div>
</blockquote><div style="font-family:Arial;"><br></div>
</div>
</div>
<div style="word-wrap:break-word;"><div>I've incorporated all the feedback to date and updated the gist:<br></div>
<div><br></div>
<div><a href="https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b">https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b</a><br></div>
</div>
<div style="word-wrap:break-word;"><div><br></div>
<div>-- E<br></div>
<div><br></div>
<div style="font-family:Arial;"><br></div>
</div>
<div style="font-family:Arial;">_______________________________________________<br></div>
<div style="font-family:Arial;"> swift-evolution mailing list<br></div>
<div style="font-family:Arial;"> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br></div>
<div style="font-family:Arial;"> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote></div>
</div>
</div>
<div><u>_______________________________________________</u><br></div>
<div>swift-evolution mailing list<br></div>
<div><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote><div style="font-family:Arial;"><br></div>
</body>
</html>