Maybe Let’s Not Make Array Subscript Return an Optional

Airspeed Velocity:

…developers would probably start to get unwrap fatigue. They inspect the code, see that there’s no way the index could not be valid (there’s no index arithmetic going on there, just use of an index that is guaranteed to be within bounds), and just force unwrap instead.

This is a slippery slope. Once you start doing that, you do it all the time.

09 Aug 2014


Ads via The Deck