[swift-users] Comparing POP to OOP

Jon Hoffman hoffman.jon at gmail.com
Wed Feb 17 10:18:45 CST 2016


I do agree that there isn’t a lot of functional innovation with POP however where I would disagree is saying it is the same paradigm as OOP (or other programming paradigm).   And it is OK to agree to disagree that is where good discussions can be found.

The reason that I would disagree is because how we think about the design is different.  With OOP we have the single monolithic superclasses with class hierarchies.  With POP, I believe the design may be closer to the Entity Component System described in Adam Eberbach’s e-mail because POP encourages a more modular or component design for our types using protocol composition and protocol inheritance. 

I do agree that languages can cater to different programming paradigms.  To be honest, programming paradigm basically boil down to how we architect our application and in my opinion how we architect/design our application with POP is different than OOP because we design/compose our types differently and we are no longer encouraged to use class hierarchies which is really the backbone of OOP.

Jon

> On Feb 17, 2016, at 10:39 AM, Daniel Tartaglia <danielt1263 at gmail.com> wrote:
> 
> Ah yes Wallacy! That’s the point I’m making. 
> 
> Procedural, Functional, Modular, and Object Oriented programming are different paradigms. Languages can cater to different paradigms by making it easier to code in some than others, but the paradigm has nothing to do with the language per se. You can do OO in C with function pointers, it just requires more typing.
> 
> The point I’ve been trying to make to Jon is that POP is not a new paradigm, but it *is* a better syntax for the same paradigm. Better syntax is a great thing and deserves accolades, but don’t make it out for more than it is.
> 
> 
>> On Feb 17, 2016, at 9:20 AM, Wallacy <wallacyf at gmail.com <mailto:wallacyf at gmail.com>> wrote:
>> 
>> If you go further, you will realize that Objects are only Structures with some function pointers.
>> 
>> The differences on structured programming and object-oriented programming can be reduced to a "syntax level" too.
>> 
>> POP for example encourages more use of multiple (inheritance|composition) than OO. The pattern is more important than syntax.
>> 
>> However I agree, Swift POP still have many limitations and almost no innovation. There are several proposed improvements to protocols that should arrive in the next versions, maybe then people start to consider POP a true paradigm. For now is just a syntax sugar for Composition over inheritance.
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160217/bf58dc89/attachment.html>


More information about the swift-users mailing list