Lessons Learned In Building A Small Project

Lessons Learned In Building A Small Project

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.

classautoload.JPG

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.

porperties.JPG

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.

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. Github Repo