On Sun, Sep 25, 2016 at 4:19 PM, Trans via swift-evolution <
swift-evolution@swift.org> wrote:
> As I've been learning Swift recently, one aspect of the language
> jumped out at me with a "code smell". Namely, the way Optionals are
> handled. For starters, just consider how long this chapter is:
> On 26 Sep 2016, at 00:26, William Sumner via swift-evolution
> wrote:
>
>>
>> let roomCount = john.residence.numberOfRooms
>>
>> // error: value of optional type 'Residence?' not unwrapped; did
>> you mean to use '!' or '?'?
>>
>> As general rule of thumb,
> On 25 Sep 2016, at 21:19, Trans via swift-evolution
> wrote:
>
> "john.residence.numberOfRooms" could just behave one way or the other
While I understand where you're coming from, I think the problem is that
whichever version we specified as a guess would be
On Sep 25, 2016, at 4:19 PM, Trans via swift-evolution wrote:Basically "john.residence.numberOfRooms" is a completely wasted_expression_ -- it's meaningless.Not true; it's an attempt to access the `numberOfRooms` property on `Optional`. That property doesn't exist, but
> On Sep 25, 2016, at 2:19 PM, Trans via swift-evolution
> wrote:
>
> As I've been learning Swift recently, one aspect of the language
> jumped out at me with a "code smell". Namely, the way Optionals are
> handled. For starters, just consider how long this chapter
As I've been learning Swift recently, one aspect of the language
jumped out at me with a "code smell". Namely, the way Optionals are
handled. For starters, just consider how long this chapter is: