Advanced Swift: Protocol Oriented Programming |

Swift protocol oriented programming gives you the power of object oriented programming with better composability and without the baggage of class inheritance.

This is a companion discussion topic for the original entry at

Swift is the first protocol oriented programming language? That seems false, is that really true?

Haha. Certainly there are other languages that support protocol oriented programming (regular types as proposed by Alexander Stepenov). C++ and Haskell come to mind. But I think their support is much the way C supports object oriented programming. You can do it, but it isn’t quite as straight forward as it could be. In that sense, Swift supports POP in a more native way.

I think you can really see this with the design of Sequences, Collections and Algorithms in the standard library. (Maybe there will be a future video on that soonish?). C++20 looks like it will get more full featured concepts (generic protocol constraints) support which have a lot of similarities…

Anyway, it makes for a good headline and Dave Abrahams (Crusty) said it so it must be true. :] That said, if there are some counter examples you know of, feel free to post them!

you guys need to do a video series on the standard library and the main protocols especially sequence. more advanced courses would be nice. BTW the current website cuts the video controls off on the right side of the screen. im watching on an ipad. I would like to see more courses by Ray. Excellent teacher.

Thanks for the kind words. More are coming! (I am not sure exactly when because it takes a while to edit and schedule them)

Great videos!! but only 21 minute? Can you guys do C and C++ beginning and advance courses too Please??? I Love your courses!!!

@zaheerbaloch Thank you for your suggestion - much appreciated! I will forward it to the video team. Thanks again!

1 Like

I’m waiting for C++ and C, pleases do it!!!