10 Things I Wish I Had Known When I Got Started With PHP

After about two years of working with PHP and looking back this is a list of things I believe every newbie should get familiar with as soon as possible.

IDEs Don’t Bloat Code

I heard many times that IDEs add unnecessary code to your project, and for this reason I refused to try one, this is simply not true. While I agree that an editor like Notepad++ is necessary for quick edits, if you don’t use an IDE you are not taking advantage of functionalities like autocompletion that come with PHP and opensource libraries that you download.

Not only will an IDE help you code a lot faster, it will also help you learn the language or library. My favorite IDE, eclipse,  supports PHP and many other programming languages.

Read The ***king Manual (RTFM)

Countless of times I looked online for help and many many times, after implementing some crazy script I had found in a forum, I learnt that there was a function that would do all this. Nowadays I always head to the manual first.

Object Oriented Programming

You are going to have to learn this sooner or later and it will make your life easier. Object oriented Programming might seem daunting at first, but it really isn’t and there are tons of tutorials out there that will help you learn it .
My favorite OOP resources:

Learn an MVC Framework

Am actually at newbie with MVC frameworks, am learning CakePHP and CodeIgniter currently, but I just want to let you know that it doesn’t matter which framework you prefer, MVC is hands-down the best way to program, if you learn an MVC framework you will be able to code big projects in no time and most of your site’s security issues will be taken care of.

For newbies I suggest starting with CodeIgniter, but don’t settle for this one, there are many other MVC frameworks you need to check out.

Do AJAX With a Library

I remember coding my first AJAX contact form with raw javascript, it was a pain in the butt to say the least, I wish I had known about all these great Javascript libraries.

Check out the JQuery tutorials I’ve written.

Be Familar With APIs

Many websites let you use their code or content to build your own site, this is what an API is,  sometimes this code might be the solution to your problem,  just make sure that when you choose API you read the terms of service of carefully to be sure that your site will be built on a strong foundation.

For a list of almost all of the APIs available online visit Programmable Web.

Learn about ten great APIs

Security Issues

Learn about all the built it filtering functions PHP has available out of the box but also learn about topics like basic security tests, how to really hash a password and ways to protect against SQL injections.  Again, if you use a framework most of these issues will be taken of but you should be familiar with them any ways.

Learn Another Language

Yes! Even if you are new to PHP you should consider learning a different language. When you learn a new language you become better at the others because you import better techniques from one language to the other. Consider learning Ruby or Python since they both have great web development support.

Visit the Ruby from scratch tutorials I’ve written.

Good Websites

A Great Book

This is for me the best PHP book out there, I still have the 3rd edition even though it’s now on its fourth.