Hi,
It won't take you 6 years to understand OOP. OOP is about ownership and responsibility. Procedural is about functionality.
From a procedural point of view a user is an array with certain fields like id, username, password, ... Any function can freely use, modify, or even remove these fields as they see fit.
Nobody owns the data, and so anything can do to it what it wants.
In OOP you assign a class with the ownership and responsibility of this data:
class User {
private ?int $id = null;
private string $username;
private string $password;
}
In the above example the User class owns the data, and doesn't allow anyone to touch it. Not very useful.
class User {
private ?int $id = null;
private string $username;
private string $password;
public function changeUsername(string $username) {
assertLength($username, 8);
assertNotProfane($username);
assertNotSameAsFirstOrLastName($username);
assertNotSameAsEmail($username);
$this->username = $username;
}
}
Now the User class allows changing the username, if ALL requirements are met. Otherwise it will throw an Exception.
Exceptions are a big part of OOP, it ensures your code follows a controlled path, like an assembly line, any bad items are cast to a different line.
The advantage of encapsulating data is that there is only one place that controls access to the data, and not hundreds of places.
So that if your requirements change, you can make the change in one place and not spend weeks tracking down all uses.
I am not saying you should switch to OOP, just that it won't take you 6 years as the concept is quite simple.