Alright, I'll admit it! I am hardly a PHP expert myself but I thought I would write this anyway as it should be of some use to someone out there. Here are a few tips that should hopefully help you if you just starting out with the language.
1) Do not rely solely upon one source for instruction and tutorials. I seriously recommend making use of all of the resources available to you whether they be from books or the internet. The Official PHP site, PHP Freaks and PHP Builder are your friends. There is so much out there to learn.
2) Does the_cat look better than theCat? Make your mind up early as it can be quite offputting naming a variable the_cat in one program and theCat in an other. It is best to decide on a convention for naming variables early on your PHP career as consistency is your friend in the long run.
3) Do not follow examples/tutorials blindly on the internet. This is important. A site may be trying to demonstrate a programming concept by using the example of a car company. If you've no interest in cars you won't be in the slightest bit interested. Why not try applying it to something you are interested in like music or sports?
A good example of this was when I was trying to learn about classes in PHP. I had major difficulty staying awake as most of code I read was based around the analogy of a bank or something. So instead I decided to alter the example and create a class based around a soccer player. I couldn't believe how easily I grapsed the concept after this. As with everything in life if you are interested then half the battles won.
4) Comment your code whilst you are working on it. This is not a suggestion but an order. As you grow more competent with the language your coding style will inevitably change and you'll begin questioning your sanity when you look at your old code. Believe me, you'll think someone has broken into your computer and tampered with your scripts. "Was my code really that shabby? What the hell's this meant to do?!?!? Whaaa?????" are all phrases I've caught myself uttering whilst revising old code.
5) Read the PHP manual regularly. Its amazing how many times at the start you try to code a function that is already built into the language. This can be very frustrating.
6) Do not be frightened about writing bad code. Get stuck in and make your mistakes early as it's only through godawful errors that your programming style will evolve. It can be extremely frustrating at times, but if you take a pro-active attitude to programming and do a little bit of research on the difficulties that you've been encountering then you'll overcome these hurdles and you'll become a stronger programmer.
7) print_r() is your friend, particularly when it comes to debugging arrays. It can be crucial when it comes to diagnosing simple but persistant problems.
8) Once you feel confident in your ability as a PHP programmer, I seriously recommend joining Rentacoder. It will give you practical experience in working with clients from all over the world and will force you to improve upon your understanding of the language and web design in general.
9) Play around with PHP and use its built-in functions to create something goofy. Let your PHP IDE be your sketchpad. This is meant to be fun god-damnit. Not a chore!
10) Download PHP Designer 2006. Trust me, it makes programming in PHP a hell of a lot easier. Plus its free, which is always good when you are a cheapskate student like myself.
Written by Matt for Take More Risks
Thanks for your informative post!!! After completing my graduation, i am confused whether to choose web design as my career. Your article helped me to make a right choice.
ReplyDeleteRegards,
PHP Training in Chennai | PHP Course in Chennai
This php tips are really very helpful to me, please update your blog regularly.
ReplyDeleteRegards,
web designing course in chennai|web designing training
Very helpful tips, please give more suggestion in your upcoming blog.
ReplyDeleteRegards,
DOT NET Training in Chennai
Informative post indeed, I’ve being in and out reading posts regularly and I see alot of engaging people sharing things and majority of the shared information is very valuable and so, here’s my fine read.
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery