I have been using Swift nearly exclusively for iOS projects since its release (for better or worse). I love the fact that a compiling application gives me some sort of guarantee that I won’t encounter a nil reference (unless of course I ignore optionals and force unwrap them…not a great idea).
When pulling values out of a Dictionary, we get an Optional value which makes perfect sense. Why does this not extend out to Arrays? There is no guarantee that when I am pulling the 8th element out, that it will have a valid value.
It seems odd to me that Optionals are a fundamental part of the language but they don’t extend to Arrays.
On Tue, Dec 15, 2015 at 1:08 PM, Sean Kosanovich via swift-evolution < swift-evolution@swift.org> wrote:
Hello all!
I have been using Swift nearly exclusively for iOS projects since its
release (for better or worse). I love the fact that a compiling
application gives me some sort of guarantee that I won’t encounter a nil
reference (unless of course I ignore optionals and force unwrap them…not a
great idea).
When pulling values out of a Dictionary, we get an Optional value which
makes perfect sense. Why does this not extend out to Arrays? There is no
guarantee that when I am pulling the 8th element out, that it will have a
valid value.
It seems odd to me that Optionals are a fundamental part of the language
but they don’t extend to Arrays.