Object oriented programing in a couple minutes
The basics
3/21/20261 min read
OOP is an Ideology inside of Coding. It uses classes, functions and variables as its main components. There is also inheritance, abstraction, polymorphism and encapsulation, but we will only focus on the main components in this lesson
What languages use OOP?
Languages that use OOP include Java, Python, C++, C#, Lua, and Go, just to name a few. Every language has different OOP functions and definitions! some just have functions and variables, others have inheritance and pillars as well!
What is FP compared to OOP?
FP (Or functional programming) is the inverse of OOP: instead of classes they just put the info in the open! In FP everything is global and is usually harder to read. But in OOP we can use inheritance and functions and other objects to make our programs!
When to use FP:
If you are writing short code
If you are writing 12+ files
if you are writing 1-2 files
when to use OOP:
if your code is long
if you want readability
if you have a lot of repetition or recursion
conclusion
in conclusion, OOP is a large part of coding software!