[swift-evolution] Proposal: Deprecate optionals in string interpolation

Jeremy Pereira jeremy.j.pereira at googlemail.com
Mon May 23 06:10:33 CDT 2016


> On 19 May 2016, at 18:06, Krystof Vasa <kvasa at icloud.com> wrote:
> 
> I'm wondering which scenario this is actually wanted behavior:
> 
> - strings that are for user interaction? Definitely not.

There would almost certainly be other manipulation going on that renders this moot for user facing strings, for instance, you would never interpolate a date without running it through an NSDateFormatter.


> - logs? To be honest, the logs riddled with Optional(value) are pain to read. Following example:
> 
> key1: Optional("Value")
> key2: nil
> 
> vs
> 
> key1: Value
> key2: nil
> 
> Which is more readable in the log?
> 

Which is a ore honest representation of the variable you are logging?




More information about the swift-evolution mailing list