Codementor Events

How I learned PHP

Published Jun 15, 2020Last updated Jun 17, 2020

About me

I am a web developer. I completed my B.Tech with Computer Science & Engineering branch in 2015. Later on, in October 2015, I got my first job and moved to Romania. You must be curious about why Romania? I fell in love with a Romanian girl, hence the move. I have changed my job to the current one in May 2016. With time, I have enjoyed learning the new aspects of web development and I must say, the more you grow in this field, every single piece which you have learned separately, falls into place, completing the big picture of how the web works. Seeing it in action is a pretty satisfying feeling.

Why I wanted to learn PHP

While being in college, as far as programming languages go, I learned C, a bit of C++, and then JAVA. As web technologies, we learned HTML and Javascript. In my final year, I have made a small web application called "Language Learner" using JSP backend and HTML, JS front end.
My first job was in a company where they developed programs in C++ to go with excel for inventory purposes. As I had a good knowledge of C and JAVA, it didn't take long for me to get good grasp of C++. Although the job fit the prescription of a job in IT field, I always felt out of place. I always wanted to be a web developer. So I decided to search for web development jobs in my city.
I came to know that most of the companies in the market were using PHP related frameworks such as Wordpress, Joomla, etc. That's when I knew that if I am ever going to get any job in web development in Romania, then I had to learn PHP first.

How I approached learning PHP

Learning a new programming language when you already know one, is way different than learning your very first programming language. By the time, I decided to learn PHP, I already knew C, C++, Java, and Javascript. To be honest, if you put all these together on the table, there was nothing new in PHP to learn other than the syntax and built-in functions.
I actually felt a breeze of fresh air because PHP was so much loosened up compared to JAVA and provided so much flexibility compared to C. I first learned procedural PHP and once I had a good grasp of syntax and build-in functions, I moved to OOP. The concept of OOP was already familiar due to JAVA, so I felt right at home there as well.
It took me 3 months to grasp a good enough knowledge to be able to apply for my first web development job which I got and currently working in.
The main source I used to learn PHP was; https://www.w3schools.com/php/ and the best reference for anything in PHP, you can find it at https://www.php.net/
In my opinion, this is why learning PHP is so much easier because everything is well documented. Rest, of course, there is Google and StackOverflow. So those were my basic sources of learning.
Once I had a good grasp of a topic, I used to search problems related to that topic on net, it's not hard to find the basic problems on particular topics, such as arrays or string manipulation, etc, The more I learned, the more I was able to take on the complicated problems.
As my own final test, I created a TicTacToe game, 1v1, and 1vC version using only PHP and HTML.

Challenges I faced

The biggest challenge I faced was not knowing if what I did was the best way of solving a problem or not. This is actually always the case if you do not have anyone to guide you with enough experience in the language you are trying to learn.
The second challenge, I would say was the lack of problems on the internet. This creates a lack of confidence because you never know where you stand and how much do you know if you do not have a proper series of tests available.
If you pay for services such as Codecademy, you can have that. However, I learned it on my own, so I did face those challenges.

Key takeaways

  • If it is your first language, then have patience, it can take anywhere from six months to a year to actually get the grasp of it because not only you are learning a new language but also the concept of a language, compiler, and how does it all work.
  • Subsequent languages you learn will have a lower learning curve.
    Never rush the learning process, it is OK to repeat over and over the same content for days to get a solid foundation. If you rush things up, chances are you might end up taking two times more the time than normal.
  • Always rely on the official source whenever you meet any conflict. For example for PHP, I would say php.net is an official source and you can believe everything there (not the user-contributed notes). Always try to find official sources, rather than personal blogs when trying to resolve a conflict.

Tips and advice

  • Challenge yourself with new problems. Programming is the same, no matter what the language so if you can't find questions to solve in the language you are learning, find questions in any language, and try to solve it using the language you are learning.
  • Always remember, you are after the knowledge, not the job you will get based on that.

Final thoughts and next steps

After I started my job, I learned Wordpress, Joomla, and Laravel. Obviously I had to learn about MVC structure in order to learn these PHP frameworks. So I would say next is to just keep going and learning whatever new comes in the field. For example, at the moment, Laravel is a really popular PHP framework but maybe tomorrow there will come a new one so I will learn that and so on.
This can be a catch or a deal-breaker of web development domain that, you need to keep on learning, or you will fade real fast.

Discover and read more posts from Abhay Maurya
get started
post commentsBe the first to share your opinion
Show more replies