[swift-evolution] Abstract methods

Adam Kemp adam.kemp at apple.com
Thu Nov 2 16:20:00 CDT 2017


Swift does still have inheritance, though. A language with inheritance and not abstract is frustrating to use, as evidenced by the hacks people resort to for Objective-C.

If we wanted to steer people away from inheritance then maybe we shouldn’t have supported it at all, but it’s a bit late for that.

> On Nov 2, 2017, at 1:57 PM, Taylor Swift via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Swift architectures use much less inheritance (and class types) in general than equivalent c++ architectures. personally i have never been in a situation where i didn’t need a pure abstract method that was better declared as a protocol requirement.
> 
>> On Nov 2, 2017, at 2:45 PM, C. Keith Ray via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> How many "subclass must override" assertions or comments in base class methods do we need to see, to want to add "abstract" to the Swift language? 5? 50? 500?
>> 
>> It's a not uncommon idiom in Objective-C.
>> 
>> I'm about to port a substantial amount of C++ code to swift, and compiler help to enforce abstract classes would be very useful.
>> 
>> 
>> --
>> C. Keith Ray
>> Senior Software Engineer / Trainer / Agile Coach
>> * http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
>> 
>> 
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> 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/20171102/1f6bc8cc/attachment.html>


More information about the swift-evolution mailing list