# OOP vs POP

## Overview

The main difference between OOP & POP is inheritance.

POP focuses on what an object can do, while OOP focuses on what an object is  ([Rebeloper](https://www.youtube.com/watch?v=WYx2hMiV-DU)).

**Value Type:** struct, enum

**Reference Type:** Class

## Object-Oriented Programming

### Properties

* Inheritance from one SuperClass.
* It focuses on what an object is ([Rebeloper](https://www.youtube.com/watch?v=WYx2hMiV-DU)).

## Protocol-Oriented Programming

### Properties

* Inheritance from other Protocols and even from multiple Protocols.
* Allows smaller and specıfıc protocols.
* It focuses on what an object can do ([Rebeloper](https://www.youtube.com/watch?v=WYx2hMiV-DU)).
* They have suffixes like "-able"

### Advantages

* Code clarity
* Reusability
* Separation of classes

\ <br>

### Protocol Extensions

### Things to consider

* Too granular protocols will be hard to manage.

## Protocol vs Class vs Struct

Structs are unique copies. They copy the data over and over again

## Sources

### Videos

{% embed url="<https://www.youtube.com/watch?v=WYx2hMiV-DU>" %}

### Articles / Documents

* [Medium / Kasun Madhumal](https://kasu0772051325madhumal.medium.com/difference-between-struct-protocol-and-class-in-swift-c01f99fe08c8)
