So I realized that I didn't grasp a lot concepts when learning PHP and programming in general and part of that was not learning to build some projects and little apps that help you grab the basics. I just run towards a big project or something. It took a failed interview for me to realize that I had to go back to the drawing board, a lot of things I figured I needed to learn how to do right. One of them is also blogging, hence I'm writing this article.
I started out by just going through the basics again and this time with PHP where I decided to build a simple calculator after following an exercise and no, I did not do a code along. When using tutorials to learn, it's important that you try to do what you have learnt without the assistance of the instructor and repeat out loud to your self the reason why each piece of code exists. You must be able to explain your code to yourself first before you able to explain it to someone else.
In this particular pet project, I built a simple calculator in PHP to understand how to use Object Oriented Programming and not just have it as a concept in my head. So even in my sleep, I think I can code it all over again, at least redid the whole thing twice. Initially, I never knew you could write a piece of code to auto load your classes and that was one key thing I learnt today.
Also understanding the difference between the object properties and the parameters __construct function was quite important as one can tend to confuse both, especially when they have the same naming.
All in, it was a good day for me. Dropped a tweet as well on what I achieved for today using the #100DaysOfCode on Twitter. It helps to keep you committed.
Uncle D π β’@dante_frankD2 #100DaysOfCode
Built a Simple calculator using Object Oriented PHP Programming. Was just basically to put in to practice what I had learnt and also how to autoload classes. Really great stuff. Think I should write on it next.
#CodeNewbie #php23:12 PM - 06 Aug 2020
Hope you enjoyed this article and if it's worth your time and you can check out my code and leave a feedback. Thank you.
DanteFrank / Calculator-OPPP
Simple Calculator built using OOP in PHP
Calculator-OPPP
Simple Calculator built using OOP in PHP.
This is basically to help understand the concepts of Object Oriented Programming In PHP and how to auto load classes.
Top comments (0)