[swift-evolution] Proposal Sketch: simplify optional unwrapping syntax
Tino Heth
2th at gmx.de
Sun Dec 20 05:29:38 CST 2015
One question first: Have you thought of user trying to do
let object.someProperty
?
The syntax looks like a nice shortcut at the first glance, but we shouldn't forget that there is already a different shortcut involved in many of those assignments:
self.foo...
> But, “if let foo = foo {}” makes no sense to anybody but people familiar with swift already.
I've to agree on that — imho the syntax isn't very intuitive.
But it has the advantage to make clear that you declare a new value with the name "foo" (without explaining why that new foo has a different type despite using the normal assignment operator… I wonder if there has been a discussion about something like "?=")
For me everything boils down that we as programmers put a lot of stress on those tiny equal signs (to bad our natural language evolved in the way it did ;-), but that's life, and we know how to deal with it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151220/2db3de6d/attachment.html>
More information about the swift-evolution
mailing list