Non-optional values #19

Merged
merged 3 commits into from Jun 29, 2015

Conversation

2 participants
@kohtenko
Contributor

kohtenko commented Jun 22, 2015

The idea taken from SwiftyJSON. It's really useful in cases, when you don't want care about optionals.

@radex

This comment has been minimized.

Show comment
Hide comment
@radex

radex Jun 22, 2015

Owner

That does look useful. Not sure about NSDate() since it represents the current, not "empty" date, but 0, [], [:], "", etc. often do make sense.

Owner

radex commented Jun 22, 2015

That does look useful. Not sure about NSDate() since it represents the current, not "empty" date, but 0, [], [:], "", etc. often do make sense.

@kohtenko

This comment has been minimized.

Show comment
Hide comment
@kohtenko

kohtenko Jun 22, 2015

Contributor

I agree, made this value 0 in unixtime on 3b9c29b

Contributor

kohtenko commented Jun 22, 2015

I agree, made this value 0 in unixtime on 3b9c29b

@radex

This comment has been minimized.

Show comment
Hide comment
@radex

radex Jun 22, 2015

Owner

Still don't know about this… Is 1970 a natural, obvious "null value" that we want people to use, implicitly?

Owner

radex commented Jun 22, 2015

Still don't know about this… Is 1970 a natural, obvious "null value" that we want people to use, implicitly?

@kohtenko

This comment has been minimized.

Show comment
Hide comment
@kohtenko

kohtenko Jun 22, 2015

Contributor

I believe this value is "default enough" :) If someone wants to make sure about null value - there is date and hasKey methods.
unixtime 0 always been debatable value, but everyone knows that this is 01.01.1970

Contributor

kohtenko commented Jun 22, 2015

I believe this value is "default enough" :) If someone wants to make sure about null value - there is date and hasKey methods.
unixtime 0 always been debatable value, but everyone knows that this is 01.01.1970

@radex

This comment has been minimized.

Show comment
Hide comment
@radex

radex Jun 22, 2015

Owner

Hm, I'll think about this.

Not merging this PR just yet, but I will ;)

Owner

radex commented Jun 22, 2015

Hm, I'll think about this.

Not merging this PR just yet, but I will ;)

@radex radex merged commit 3b9c29b into radex:master Jun 29, 2015

@radex

This comment has been minimized.

Show comment
Hide comment
@radex

radex Jun 29, 2015

Owner

Merged. Thanks.

I removed objectValue and dateValue before merging. I'm not convinced of the usefulness of their default value behavior. I'd rather people do this explicitly.

(If people complain about this and make a convincing argument for it, I'll put it back.)

Owner

radex commented Jun 29, 2015

Merged. Thanks.

I removed objectValue and dateValue before merging. I'm not convinced of the usefulness of their default value behavior. I'd rather people do this explicitly.

(If people complain about this and make a convincing argument for it, I'll put it back.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment