I started learning oop about 6 months ago, although I stopped for a while because of studies.
The problem is that whenever I use oop in my project I usually try to just make every single thing a class… Whether intialization, displaying, looping and much more… to be precise, I haven’t gotten the concept of when to use to create classes.
Another problem is that I tend not to know the major benefit of a classes over a functions . Currently, I just mix them up.
I watch a youtube video that talks about classes and client code. In that video they said that classes are more of like developer codes while client codes are codes we write which uses the developer code to make things easier. So he advise we break our code to client/developer code.
But I don’t know how to break my code into client code and developer code.
Infact at a point I was creating classes for all my pages like index.php, about.php
$title = 'about page';
$page_color = 'red';
After writing the above code I know I am not doing something right. I have tried to search google and have read many oop books but each time they use the car class example which I can not apply to my coding or just wouldn’t address the context were a class is or isn’t necessary.
Note: I am comfortable building website using procedural codes but I need to learn oop incase I need it someday.