Procedural vs OOP

In this tab, we'll talk about some of the benefits of OOP vs Procedural Programming.

Benefits of OOP

A lot of people ask, why use OOP when using OOP takes much longer? Indeed, it's true that OOP takes much longer IF your project is really small. However, as your project gets bigger and bigger, OOP will save you hours/weeks/months of development time. Following are some key benefits of using Object Oriented Programming.

  1. It allows you to leverage other people's codes (libraries, APIs, frameworks).
    We know that a class is just a collection of functions and attributes that serve as a blueprint. Let's say that you are inventing a library with a lot of useful functions. Then there comes a time you want to invent a framework too (basically, a fancy word for a bunch of classes) with built-in functions for other developers to use.

    With OOP, you can create several classes for other developers to inherit and use. This is not impossible because someday, you will create your own library and framework from scratch using only the fundamentals and OOP we taught! No magic! Since all of your functions/methods are contained in your own classes, other developers do not even need to modify your class/functions in order to use them (hence, already dynamic). Developers can simply create their own class and have it inherit some of the classes you wrote (and thereby gain access to all of the cool functions you built)! This saves a lot of time and allows you to leverage other people's codes.


  2. It allows you to maintai...