Live data from Hacker News

Ask HN: What's the best way to start learning PHP?

news.ycombinator.com

11–20 of 21 posts

Re: Ask HN: What's the best way to start learning PHP?

#12
The way I became a journeyman PHP-er was to mess around with Wordpress. There are enough resources out there that Wordpress will give you the basic knowledge.

That's not to say it's good or talented knowledge, but it's basic knowledge. (People don't like that Wordpress mixes templating with code. It's unelegant and sorta gross.)

Re: Ask HN: What's the best way to start learning PHP?

#13
post #12

The way I became a journeyman PHP-er was to mess around with Wordpress. There are enough resources out there that Wordpress will give you the basic knowledge. That's not to say it's good or talented knowledge, but it's basic knowledge. (People don't like that Wordpress mixes templating with code. It's unelegant and sorta gross.)

This is not an attack on you personally but I absolutely abhor the inner workings of wordpress and would thoroughly recommend against it for a beginning developer.

A much better approach would be to start a simple html/css based website and start abstracting out common elements, building a templating system, get content from a database, dispatch http requests with a front controller until you've got something that looks like an MVC based system.

Then you start from scratch and do it again, learning from the horrible code you wrote the first time.

Eventually you realize that a framework does it better than you and learn to use rails, zend etc.

Re: Ask HN: What's the best way to start learning PHP?

#14
Come up with an idea for a project and write down the process. For instance say I want to build something like HN. I would write down something like I would want all post titles displayed , if someone clicks on the link display the entire post. Not sure if that makes sense but writing it down especially if it is a complex project you have in mind will help you see the flow of things and will make coding it a bit easier.

Next step is to build your project and google your way through it. With your guideline that you wrote it will help you look up things and once you see the code matched with what you wrote things will click more. Don't just copy and paste what you see but learn what the code is doing and if need be look up things you do not get like "die" or why echo instead of print.

Lastly read up on security since what ever you build will probably not be able to go live. Read why that is and how to fix it.

Re: Ask HN: What's the best way to start learning PHP?

#17
I'd recommend this book:

http://www.amazon.com/Build-Database-Driven-Using-MySQL/dp/0...

It assumes you are comfortable with basic HTML and text editing, and nothing more. In the process of building a basic CMS, you cover pretty much everything you need to know to build whatever you really want to build, as far as the language goes.

Re: Ask HN: What's the best way to start learning PHP?

#18
I asked a similar question a while ago: http://news.ycombinator.com/item?id=1697995

Going off the suggestions there, I decided to use the ZEND framework and I've been using the following book: http://amzn.com/1430218797

If you want to build a CMS project, I would highly recommend this book. The examples and code are really easy to follow. Good luck and feel free to email me if you have any questions!

(Note: I did have some RoR experience, but I was completely new to PHP)

EDIT: Curious to know - how does HN feel about starting with the ZEND framework?

Re: Ask HN: What's the best way to start learning PHP?

#19
When I decided I wanted to learn coding, this is the first book I purchased, and I can't recommend it enough:

http://www.amazon.com/Learning-MySQL-JavaScript-Step-Step/dp...

It goes through a good amount of material while still being a beginner's book, assuming only that you know a little html. It's very thorough in what it does cover, and should give you enough confidence to decide what you want to learn next, ie, more in-depth PHP, another language, etc.

Re: Ask HN: What's the best way to start learning PHP?

#20
post #12

The way I became a journeyman PHP-er was to mess around with Wordpress. There are enough resources out there that Wordpress will give you the basic knowledge. That's not to say it's good or talented knowledge, but it's basic knowledge. (People don't like that Wordpress mixes templating with code. It's unelegant and sorta gross.)

This is not an attack on you personally but I absolutely abhor the inner workings of wordpress and would thoroughly recommend against it for a beginning developer. A much better approach would be to start a simple html/css based website and start abstracting out common elements, building a templating system, get content from a database, dispatch http requests with a front controller until you've got something that lo…

For me, it was really about speed. I used Wordpress because I could learn it quickly and I had a modified blog (my goal) as quickly as possible. I didn't have to worry about learning how to connect to a DB, etc.

Today, I actually hate Wordpress as much as you do. I now use Crowd Fusion whenever possible, but Wordpress's introduction to PHP helped a lot.

Post reply on HN