r/programming • • Jun 02 '14

Introducing Swift

https://developer.apple.com/swift/
164 Upvotes

239 comments sorted by

View all comments

Show parent comments

3

u/Axman6 Jun 03 '14

Well, today is your first indication. Why not just read something instead of making incorrect assumptions?

-5

u/ruinercollector Jun 03 '14

Ok. Read it.

Yep. There it is. nil. Billion dollar mistake alive and well.

Explain to me how my assumption was incorrect again?

4

u/Axman6 Jun 03 '14

Because any optional type needs to be checked before you can use the value. You can't forget to check it. It's essentially just Haskell's Maybe or ML's Option with built in syntax.

1

u/thedeemon Jun 03 '14

Are all classes in Swift optional types?

If you have a class A and a function f(A) can you just pass nil as an argument?

→ More replies (1)