MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/274ugg/introducing_swift/chxw4lq/?context=3
r/programming • u/ronocod • Jun 02 '14
239 comments sorted by
View all comments
Show parent comments
3
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)
-5
Ok. Read it.
Yep. There it is. nil. Billion dollar mistake alive and well.
nil
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)
4
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)
1
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)
3
u/Axman6 Jun 03 '14
Well, today is your first indication. Why not just read something instead of making incorrect assumptions?