[swift-evolution] [Review] SE-0089: Renaming String.init<T>(_: T)
Patrick Smith
pgwsmith at gmail.com
Wed May 18 16:08:40 CDT 2016
`init(describing:)` make sense to me. I can see how it could be argued “well it looks like it calls the ‘description’ method of the argument, when it doesn’t, so this is poor naming”.
However, `init(printing:)` looks like it has something to do with `print()`, when it doesn’t. ‘Print’ is a verb, and means to print to standard output. `init(printing:)` has nothing to do with the standard output.
So, `init(describing:)`, how is it more clear? I think it is more clear as you are always getting a description. If you want a custom description, it’s obvious, you implement CustomStringConvertible’s description method. The word ‘describing’ is just based on its meaning, not on how it is implemented with the use of CustomStringConvertible or not.
Patrick
> On 19 May 2016, at 6:34 AM, Leonardo Pessoa via swift-evolution <swift-evolution at swift.org> wrote:
>
>> Hello Swift community,
>>
>> The review of "SE-0089: Renaming String.init<T>(_: T)" begins now and runs through May 23. The proposal is available here:
>>
>> https://github.com/apple/swift-evolution/blob/master/proposals/0089-rename-string-reflection-init.md
>>
>> * What is your evaluation of the proposal?
>
> As described in the proposal, it makes sense. I never faced the issue
> myself but agree to the change. I'd also go with Jacob's version
> 'init(describing:)' since there is no guarantee the resulting string
> will be printed but will surely describe the object used as argument.
>
>> * Is the problem being addressed significant enough to warrant a change to Swift?
>
> As outlined by the proposal, yes.
>
>> * Does this proposal fit well with the feel and direction of Swift?
>
> Yes.
>
>> * If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
>
> None.
>
>> * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
>
> A quick reading.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list