Re:Bringing Objective-C to the Amiga
by aplummer on Monday April 23, 2018 @04:26AM
(#16901539)
Also I agree you can tell safety was the number one priority. However the positive is basically never getting runtime errors, except when interfacing with IB or obj-c even when people are programming in a hurry, which is nice for me.
[ Parent
| on HN ]
> However the positive is basically never getting runtime errors
I don't quite think this is the "safety" that Swift aims for: rather, it prefers safety in the sense of failing fast and failing reliably if something goes wrong. Unwrapping nil and out of bounds array subscripting fall into this category of behavior.
Re:Bringing Objective-C to the Amiga
by LeoNatan25 on Monday April 23, 2018 @05:07AM
(#16901761)
"Never getting runtime errors" is as far fetched as it can be. Consider Xcode suggesting developers use force unwrap ("!"), that leads to many more crashes with unexperienced developers than the ObjC message to nil paradigm.
Subjectively, I have seen much more crashes in third-party software written in Swift than in ObjC (usually unwrapping or casting incorrectly), including in Apple's software. I cannot say if this is down to more inexperienced developers, less time allotted to experienced developers or a worse development model. I'd say a combination of the three.
I didn’t know it suggested force unwrapping, I always have a linter to prevent it except for IBOutlets etc.
This might also be because Swift is more likely to crash than fail silently at runtime.
I don’t see how this is possible, example?