News for hackers. Stuff that matters.
Re:On Apple's Love Affair with Swift by scarface74 on Saturday August 11, 2018 @12:57PM (#17740450)
I don’t know Swift, so I don’t know what you’re implying, but I only know of three ways to deal with an array out of bounds runtime issue....

1. Don’t check for it at runtime and the runtime writes to memory that it shouldn’t like C.

2. Throw an exception and prevent memory corruption.

3. Don’t ever work with indexes and just use iterators.

Is there a fourth way that it can be handled in other languages?

Re:On Apple's Love Affair with Swift by saagarjha on Saturday August 11, 2018 @01:31PM (#17740632)
You could have the subscripting method check at runtime and return an Optional.