My Killer PHP Learning Tips
September 3, 2009
Learning to program can be a frustrating process for a lot of people; especially for designer types wanting to learn a little PHP. The following tips should help a lot of you along the way to becoming a PHP nerd. My PHP learning tips:
1. Be patient:
Patience is a virtue, especially when learning to program. Don’t be discouraged if something doesn’t sink in right away. It will come with time.
2. Learn to write code on faith:
… That means writing PHP code that you may not fully understand. The process of actually writing out the code, seems to help the brain take it in.
3. Learning PHP programming is a lot like learning a sport; you can pick up stuff by sitting on the sidelines and watching, but you don’t really know what you’re doing until you actually get into the game. In PHP, that means actually writing code and not just sitting listening or reading about it.
4. Take a breather:
If something is not sinking in right away, move on to something else and come back to it later … actually, give it 24 hrs to sink in. I find that the brain will work on problems over night and almost magically, things that you could not understand the day before, will become obvious.
5. Try variations in your code:
Play with different ways of doing things, try to add variation to your code. If for instance you are learning something as simple as a conditional statement .. like the ‘if’ statement, try some examples with mathematical equations and then maybe try something using a function that returns a true/false value.
6. Break your code:
One of the best ways to learn any programming language is to purposefully break code. Why? Basically it comes down to seeing what type of error messages you get for certain types of mistakes in your code. In time, you will see that particular errors will give you consistent error messages. Once you know these, debugging code will be a lot easier.
I’ve found that breaking things on purpose and in a controlled manner, can really help down the road when you run into real errors, because you will recognize the error messages.