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.
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.
Zach Waldowski
[email protected]

On Thu, Jun 29, 2017, at 01:43 PM, ilya via swift-evolution wrote:
> 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:> 
> https://gist.github.com/ilyannn/4c5530c75293db0324a04f50ae691b2a
> 
> I understand coding styles may differ, but I do worry that we
> "promote" force unwrapping too much by inroducing another
> operator for it.> 
> Ilya.
> 
> 
> On Thu, Jun 29, 2017 at 6:55 PM Erica Sadun via swift-evolution <swift-
> [email protected]> wrote:>> 
>>> On Jun 29, 2017, at 9:13 AM, Dave DeLong <[email protected]> wrote:
>>> 
>>> My usage of “!!” generally falls in to two big buckets:
>>> 
>> 
>> I've incorporated all the feedback to date and updated the gist:
>> 
>> https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b
>> 
>> -- E
>> 
>> 
>> _______________________________________________
>>  swift-evolution mailing list
>> [email protected]
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> _________________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution
              • ... David Hart via swift-evolution
              • ... Elviro Rocca via swift-evolution
              • ... Víctor Pimentel Rodríguez via swift-evolution
              • ... Elviro Rocca via swift-evolution
              • ... David Hart via swift-evolution
              • ... Rod Brown via swift-evolution
              • ... David Hart via swift-evolution
              • ... Dave DeLong via swift-evolution
              • ... Erica Sadun via swift-evolution
              • ... ilya via swift-evolution
              • ... Zach Waldowski via swift-evolution
              • ... Djura Retired Hunter via swift-evolution
              • ... Dave DeLong via swift-evolution
              • ... Rod Brown via swift-evolution
              • ... Erica Sadun via swift-evolution
              • ... Adrian Zubarev via swift-evolution
              • ... David Hart via swift-evolution
              • ... Ben Cohen via swift-evolution
              • ... Max Moiseev via swift-evolution
              • ... David Hart via swift-evolution
  • Re: [swift-evolution] [Pit... Adrian Zubarev via swift-evolution

Reply via email to