[swift-users] Comparing POP to OOP

Jon Hoffman hoffman.jon at gmail.com
Tue Mar 8 18:57:09 CST 2016


> On Mar 8, 2016, at 2:38 PM, Dave Abrahams <dabrahams at apple.com> wrote:
> 
> 
> on Tue Mar 08 2016, Michael Ilseman <milseman-AT-apple.com> wrote:
> 
>>>> What makes protocols in Swift different from Java interfaces (or
>>>> Objective-C protocols for that matter) is that they support static
>>>> polymorphism and generic programming.
>>> 
>>> Unless I am misunderstanding what you are saying here, Java
>>> interfaces do support generic programming:
>>> https://docs.oracle.com/javase/tutorial/extra/generics/simple.html
>>> <https://docs.oracle.com/javase/tutorial/extra/generics/simple.html>
>>> 
>> 
>> I think “static” is the operative word there.
> 
> Actually, “generic programming” are the operative words.  I don't mean,
> “does the language have a feature that it calls ‘generics?’”, I mean “does
> it support the discipline of generic programming?”
> 
> See:
> 
>  http://www.osl.iu.edu/publications/prints/2005/garcia05:_extended_comparing05.pdf
>  https://books.google.com/books/about/From_Mathematics_to_Generic_Programming.html?id=UqxYBQAAQBAJ
> 

I have always looked at Generics from a Java point of view because that is the language in which I started really using them with my code.  I did start reading the document during my daughter’s TaeKwonDo class tonight and it does seem pretty interesting.  I will have to make time to read it in the next few days.  Page 4 of the document has a chart that shows how the different languages compare.  I can see, just from the top of my head that Swift has better support than some of the languages however not as well as Haskell or SML.  How do you see Swift currently comparing to the other languages and how do you see it comparing in the future?

> -- 
> -Dave



More information about the swift-users mailing list