Procedural VS Functional VS Object-Oriented Programming

Cokro Yongky Pranowo
mtiakakom

--

When Dr. Ir. Abdul Kadir, MM, MT (My Lecture) asked to us in the class

“ What is the difference OOP, Procedural, and Functional programming?”

I think we already know, but we feel difficult to explain, hmm so today, I decided to do some research and (try) to explain in this article.

“Procedural programming is a programming paradigm, derived from structured programming, based on the concept of the procedure call. Procedures, also known as routines, subroutines, or functions, simply contain a series of computational steps to be carried out” — Wikipedia
^_^ Confused? let’s make easier.
Procedural programming is paradigm that uses a linear or top-down approach. It relies on procedures or subroutines to perform computations. In a purely procedural style, data tends to be highly decoupled from the functions that operate on it. In procedural programming, program is divided into small parts called functions. And for this paradigm, overloading is not possible. Example : C, Fortran. || How about Pascal? I think, Pascal using multiparadigm and I think it’s has been describe with wikipedia, you can read more.

“Functional Programming is a programming paradigm a style of building the structure and elements of computer programs — that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data” — Wikipedia.
Hmm Okay, make it simple.
In Functional Programming, everything is a function, or parameters to a function, rather than instances/stateful objects.
Functional Programming make you focus “What you are doing”, Flow Control is done using function calls & function calls with recursion. Functional programming does not support state, so there are no side-effect results and we can write error-free codes :) . Example : Scala, Erlang, SQL.

“Object-Oriented Programming(OOP) is a programming paradigm based on the concept of “objects”, which can contain data, in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods)” — Wikipedia.
In OOP, computer programs are designed using the concept of objects that interact with real world.
So every part of a problem is an object, now the object itself is a combination of several smaller objects. Example of the plane, the plane is an object. The plane is formed from several smaller objects such as engines, wheels, propellers, chairs, etc. Smaller objects are interconnected, and interacting to another object. Object oriented programming languages are various but the most popular ones are class-based, meaning that objects are instances of classes, which also determine their types.
Example : Java, C++, C#, Python, PHP, JavaScript, Dart.

--

--

Cokro Yongky Pranowo
mtiakakom

Web & Android Lovers ヾ( ゚∀゚)ノ゙ || Student Master of Information Technology at STMIK AKAKOM Yogyakarta