[swift-evolution] [Review] SE-0024 "Optional Value Setter `??=`"

Joseph Lord joseph at human-friendly.com
Sat Feb 13 03:56:33 CST 2016

> What is your evaluation of the proposal?
There is nothing particularly wrong with this proposal but I think we should have a reasonably high bar on adding operators. Each one is nice and reasonable but if you add them all you get a large language and there is more for a beginner to learn and for all of us to remember when reading code. 

> Is the problem being addressed significant enough to warrant a change to Swift?
No. I don't think it is. I believe (though I haven't tried it) that it is implementable as a user defined operator for those that really wanted it. There have only been a few occasions where I have had the situation to use this operator (not none but not enough). 

> Does this proposal fit well with the feel and direction of Swift?
Syntactically it is fine but I do think it encourages use of optionals where they may not be necessary. It also adds to the language/standard library surface area without sufficient benefit. 

> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
Yes but Ruby has less support for constants and all variables are nilable and I found I used it a lot there where in Swift I would be setting a constant non-optional by using nil coalescing originally rather than making a sequence of attempts to set the value. I don't miss it in Swift. 

> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Quick read of proposal. 

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

More information about the swift-evolution mailing list