Learning something from scratch is almost always an arduous affair -- you simply have no idea as to where to start, or not to start, to kick things off. I loathed learning about the idiosyncrasies of C++'s syntax when all I wanted to learn were some darn programming concepts. As I'm sure you can agree, this is a less than ideal situation.
This is where the Nettuts+ "The Best Way to Learn" series comes into the picture. This series is intended to be your blueprint, your road map, your plan of action for learning your topic of choice! You don't have to worry about finding the best resources, sorting out the bad ones, and figuring out what to learn next. It's all here. Just follow it, step by step.
Today, we're going to figure out the best way to learn PHP.
Assignment #1: Disregard the Naysayers
If you're reading this, chances are that you've Googled a lot to decide which language to learn and how. And without a doubt, you must have run into a ton of articles about how language X is so much better than PHP - and PHP is going to die through obscurity soon.
Haters gonna hate!
As the popular saying goes, haters gonna hate! PHP has been at the helm of the web as you know it and that's for a very good reason. It's a mature language, has excellent documentation and a massive number of learning resources along with a great variety of utilities built around it.
And let's not forget the sheer proliferation of hosts and frameworks PHP has spawned. Like Heroku like hosting? Don't worry, there are a number of excellent options for PHP as well!
Assignment #2: Install PHP through [X]AMP

You could just install PHP but it gets quite boring without a server and some sort of database to play around with. And as a beginner, it's not really trivial work to get all of these installed and configure each to work with the others without issue.
This is where you grab a package such as XAMPP. These life savers typically install Apache, your web server, along with mySQL, a database system along with PHP significantly cutting down on set up time.
Bonus points if you're the code monkey type and install everything by hand.
Assignment #3: Learn the Fundamentals
Before I send you off to alternate sources for PHP enlightenment, let me first refer you to our very own series for absolute beginners from none other than your favorite editor, Jeffrey Way.
In this series, over the course of 40+ screencasts, everything from installing PHP to variables, from functions to working with MySQL is covered.
Assignment #4: Sign up with Khan Academy and Lynda

Khan Academy may sound like an odd choice since there are no PHP lessons in there but trust me, it's a good choice. What you can't find in pure PHP, you can find in the basic of programming. For example, if you're new to the entire programming hoopla, this is a great place to start.
Another great place to start is Lynda. Here at Envato we have immense respect for those teaching there -- the content is usually top notch and cover their topics well. And they cover a vast range of topics as well. If you need a specific lesson, this is where you should begin.
Assignment #5: Read a Few, Good Books
The videos should give you an very good springboard, but, hopefully, hungry for more knowledge. The below books should give you a more elaborate introduction and lots of varied topics for you to devour.
If you feel bored reading the initial portions, good, just skip ahead to the portions where your head hurts.

PHP Solutions: Dynamic Web Design Made Easy
Author: David Powers
“So why another PHP book? Well, not everyone who uses PHP is a programmer. PHP is the most common dynamic web language used by designers, if their web sites require dynamic functionality, and there are hordes of novice users who want to set up dynamic web sites.”

PHP for Absolute Beginners
Author: Jason Lengstorf
“PHP for Absolute Beginners starts at the very beginning stages of web programming, showing even the most inexperienced web developer, through examples, how to build a basic content management system. The book dives directly into writing web applications with accompanying explanation rather than explaining elements of the language and then showing examples.”

PHP Cookbook
Author: Adam Trachtenberg
“PHP Cookbook has a wealth of solutions for problems that you’ll face regularly. With topics that range from beginner questions to advanced web programming techniques, this guide contains practical examples — or “recipes” — for anyone who uses this scripting language to generate dynamic web content.”
Assignment #6: Create Something Simple
This is the perfect time to build something simple with your new found knowledge.
Alright! With all those information swirling inside, you should feel like a rockstar. If not, don't worry, it's completely normal. Talk to me later so we can share notes about how daft we feel.
This is the perfect time to try and build something simple with your new found knowledge. It's best to not try to build something too complicated and fail though -- it's a lot more disheartening than you'd think. Imagine being rejected for the first time. Now multiply it by a few hundred and you'll be close.
Since you're just starting out, play it safe and build something absolutely basic like a CRUD app. Nothing major -- a few inputs and an 'uncool' table to display saved results. This tiny exercise will test your knowledge of a lot of PHP basics including the much vaunted 'interfacing with a database' skill.
Assignment #7: Create Something a Little More Complicated
Feeling better now? You should! You gazed upon where there was naught and said 'This won't do!' and created something from scratch. If it were me, I'd be pumped. Let's use it to extend our knowledge a little more.
While a simple CRUD app is a great start, you'd ideally need more complicated. A simple login/user system is absolutely great for this.
You get to learn how sessions work, how basic authentication is done, how to implement basic security measure and a ton more.
Note: If you're in need of a little guidance, start here.
Assignment #8: Try out a Lean, Lightweight Framework

At this point, after creating a non-trivial system, you probably have noticed how repetitive some of the work is. Why the heck do you need to write your own sessions class or work on hashing passwords yourself? The answer, my friends, is to go with a lightweight framework.
A framework abstracts a lot of the repetitive, boilerplate features in your typical application thus freeing up your brain to actually getting things done.
Note: Not to toot our own horn but we have an immensely thorough session that covers almost all of the important parts of CodeIgnier, a very lightweight, yet powerful framework. If you prefer Kohana, we do that too!
Assignment #9: Try out a Full Stack Framework

Now that you've been with a lightweight framework, you can now check out the alternate path -- a full stack framework. A full stack framework typically ships with a lot more features including code generators, ORMs and an inbuilt server. An excellent choice would be CakePHP -- the PHP equivalent of Rails.
The reason you need to check these out later is because there is a lot of 'magic' going on. Without a solid understanding of how lightweight frameworks work, it's hard to really dig into the better featured ones since you'll mostly be lost and won't understand how things work.
No comments:
Post a Comment