[swift-evolution] [swift-evolution-announce] [Review] SE-0041: Updating Protocol Naming Conventions for Conversions
pyry.jahkola at iki.fi
Wed May 18 14:34:23 CDT 2016
> On 18 May 2016, Brent Royal-Gordon wrote:
> I don't think `Convertible` is clearer than `Initializable`, but I think it rolls off the tongue better, is easier to spell, is more compatible with non-initializer implementations, and in general wins on a lot of squishy, subjective, hard-to-define axes.
> Subjectively, I've noticed that a lot of people *don't* think of things like `Double(myFloat)` as being initializers; they think of them as conversions. To those people, `Convertible` is probably the right name.
Isn't it odd that we use four different terms for both kinds of String conversions that we have?
A1: extension Foo : CustomStringConvertible // proposed: CustomStringRepresentable
A3: String(foo) // or `String(printing: foo)` if SE-0089 gets accepted
B1: extension Foo : CustomDebugStringConvertible // proposed: CustomDebugStringRepresentable
B3: String(reflecting: foo)
I don't have great suggestions but wouldn't it be better to move the naming of cases 1 & 2 towards the words used in cases 3 & 4?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution