One of the methods of learning PHP that I described in a previous post was to learn by searching for things when you need them. Here’s a guide to using that method.
Using Google as part of the learning process
There are many ways that you can utilize Google, or any other search engine, into your learning process. No matter what you’re learning, there will be things that you don’t know how to do. A search engine can help you achieve all of these tasks very easily.
Think of Google as your gateway to all of the resources available on the web relating to PHP. Using these resources, you can piece together your knowledge of the language until you are fluent enough to start to ween yourself off of them and write code independently.
There are basically two types of resources that you can find using a search engine: specific tutorials, such as this tutorial of how to make a login script, or reference pages, such as this reference page for print_r(). These are the only two types of resources that you need. The latter is much more important than the former.
Using just these reference pages, you should be able to piece together scripts that do what you need. After using this method for a long enough time (it really depends on your ability), you should be able to start to code on your own.
Try this method to learn PHP. It will require some prior knowledge of the language, but nothing more than a simple tutorial on the basics.
- Decide on a task that you want to complete. This can be anything. Here’s a few examples: a login script, a simple blog, etc.
- Map out everything that the script will need to do. Break things down one action at a time. For example, if you are working on a login script, focus on registering before you even think about logging in. Here’s more information about code planning and pseudocode.
- Start to code the script using only resources that you find using Google. This may be difficult at first, but you will eventually get the hang of it. There’s enough resources out there that any reasonable search query will get you where you need to go. For example, if I was looking for the function print_r(), I could search for ‘php output array’, ‘php print array’, ‘php echo array’, ‘php view array’, and all of these queries would lead me in the right direction.
- If you have a problem, try things until it works. Don’t ask for help unless it is seriously needed. If you do ask for help, do your best to get only what you need. Trying to speed up this process isn’t going to help you since it will just make it longer.
Reasons to try this method
I feel that this method helps to speed up your learning of the language. Instead of relying on specific tutorials for every (although you can still use them) or the instruction of others, you are completely independent as a coder. I also feel that you know something better if you taught it to yourself instead of having it spoon fed from someone else.
The use of this method doesn’t have to stop when you have mastered the language. You will always find problems that you may not know how to solve and you can always apply this method of independently searching for an answer. That’s a great skill to have, especially if you start freelancing or working on scripts that are not your own.