[swift-evolution] [RFC] "Library Evolution Support in Swift ('Resilience')"
dabrahams at apple.com
Wed Feb 10 15:42:25 CST 2016
on Mon Feb 08 2016, Charles Srstka <swift-evolution at swift.org> wrote:
>> On Feb 8, 2016, at 9:24 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>> The library author still needs to document what the default behavior
>> is anyway, so that users know if they want it, and they need to be
>> very careful in changing existing programs, so that they don't break
>> anyone who was depending on the old behavior
> It seems to me that using a default parameter means you don’t care
> about its value. If you explicitly want a certain value, and
> especially if you’re *depending* on a certain value, it would be best
> to supply that value explicitly. Using the default is saying “eh, do
> whatever you think is best."
It can't mean that. When you call a method that has defaults for some of
the arguments, you need to know what it will mean to omit those arguments.
Otherwise, you can't take advantage of the defaults at all, and they
become a danger rather than a convenience.
More information about the swift-evolution