2 ms·
The right question to ask yourself is why this is the only alternative. It almost never is, if the program is properly designed, especially for a user-facing ap
by feanaro 8y ago
The right question to ask yourself is why this is the only alternative. It almost never is, if the program is properly designed, especially for a user-facing application.
- zoul 8y agoAs an example, the default reaction to accessing an invalid index in a Swift array is trapping. How would you solve this “properly”? Returning an optional (ie. Maybe) would be too cumbersome and wouldn’t lead to safer code in practice.