Andrew Bancroft 8/7/2015

Analyzing Swift Protocol Extensions and C# Abstract Classes

Read Original

This article explores the similarities and differences between Swift protocol extensions and C# abstract classes, written from the perspective of a developer experienced in both languages. It discusses how Swift lacks abstract classes but offers protocol extensions as a powerful alternative, inspired by WWDC15's Protocol Oriented Programming talk. The author compares how C# uses abstract classes to provide default implementations and define templates, versus Swift's protocol extensions that allow adding method implementations to protocols. The article examines abstraction mechanisms in both languages, including C# interfaces and class inheritance, and evaluates which approach is preferable for different scenarios. It provides insights into protocol-oriented versus class-oriented design, making it useful for developers working with Swift, C#, or both.

Analyzing Swift Protocol Extensions and C# Abstract Classes

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet