[swift-evolution] [Review] Replace `typealias` keyword with `associatedtype` for associated type declarations

David Hart david at hartbit.com
Mon Jan 11 15:09:35 CST 2016


I also really like the proposal but prefer the ‘associated’ keyword instead of ‘associatedtype’. Here is my review:

What is your evaluation of the proposal?

Big +1 from me. I remember that the typealias keyword in protocols confused me for quite a while: the concept of associated types is already complicated to grasp coming from a different generics model, but overloading the typealias keyword doesn’t help in the learning process. Like I said above, I would vote for the ‘associated’ keyword. Even if grammatically more correct, ‘associatedtype’ seems like a mouthful for me.

Is the problem being addressed significant enough to warrant a change to Swift?

I strongly think so.

Does this proposal fit well with the feel and direction of Swift?

Yes.

If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

After learning about associated types, I researched Scala traits and it helped me understand the concept better and enjoyed that Scala uses a clearly defined keyword.

How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

I followed the original discussion but haven’t found time to read all reviews before mine.

> On 08 Jan 2016, at 01:13, Alex Popov via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Data of 1: I am disappointed by the choice, but remain silent so I don't look like a nit picker and to not further clutter the mailing list. 
> 
> I find `associatedtype` to be clearer,  but `associated` to be much more pleasant to read and write. 
> 
>  * What is your evaluation of the proposal?
> 
> +1 for the proposal, I didn't know associated types in protocols where even a thing, I just thought it was black-typealias-magic that was out of my intellectual reach. 
> 
>  * Is the problem being addressed significant enough to warrant a change to Swift?
> 
> Definitely.
> 
>  * Does this proposal fit well with the feel and direction of Swift?
> 
> I do believe this proposal fits well with Swift, regardless of keyword chosen.
> 
>  * If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> 
> Not applicable
> 
>  * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> 
> I have been following the proposal from the start, and have read up on Associated Types in protocols. 
> 
> Alex Popov Jr.
> Principal iOS developer | Shelfie
> www.shelfie.com <http://www.shelfie.com/> | @getshelfie
> 
> _____________________________
> From: Tino Heth via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>>
> Sent: Thursday, January 7, 2016 15:22
> Subject: Re: [swift-evolution] [Review] Replace `typealias` keyword with `associatedtype` for associated type declarations
> To: Erica Sadun <erica at ericasadun.com <mailto:erica at ericasadun.com>>
> Cc: Swift Evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>>
> 
> 
> Hi Erica,
> 
> sorry for the late reaction — but I've been busy writing code instead of emails ;-)
> 
> > Why secrecy? There is none. I was asked to run a poll. I ran a poll using the best information I had at the moment.
> 
> I hope I could clear up some misunderstandings in the answer to Chris (no conspiracy theory here ;-) and that you don't have the impression I'm accusing you for the poll (I consider it to be an act of pure kindness).
> Maybe you even agree with me partially about the potential dangers of surveys:
> I still wonder why no one complained that "associated" wasn't chosen, despite being the most popular option. Sure, some may have changed their mind, but even now, there are people saying they prefer that discarded possibility.
> I can think of four possible explanations for this observation (all of them with a share of "the actual keyword is so unimportant, I don't really care"):
> - all changed their mind (great — everyone is happy)
> - participants lost their interest and have never seen the final proposal
> - participants are disappointed by the choice, but remain silent because they don't want to look like nitpickers
> - participants are disappointed by the choice, but remain silent because they lost faith in the process
> 
> I guess the last one is to dramatic to be real (I've been referring to the community process; I never had much faith in polls ;-), but the first is the only one that leaves no sour taste...
> 
> Best regards,
> Tino
> 
> To quash possible rumors: I personally do my nitpicking loud and proud, and I didn't start this tiny meta-discussion in frustration — as long as I only have to use the word with working autocompletion, "associatedtype" is fine for me ;-)
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 
> 
>  _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160111/0ba61929/attachment.html>


More information about the swift-evolution mailing list