How do I learn to program php? I have a book but I dont think I using it correctly

Started by
7 comments, last by Marly 16 years, 7 months ago
I am aware that this sounds like on of the noobiest questions ever but how do I learn php using a book. Ok I’ve read through the first part where the author walks you(me) through creating a weblog(blog), and I feel like I’ve learned a little but not much. What do you consider finishing a chapter. Should I be able to reproduce the code without help or reference? Or should I just be able to answer a few specific questions without being able to piece all the facts together. The book comes with the source on the cd and I realize that I will not be able to learn at all if I don’t look at it but what do I do with it? I can look at it and upload it to a test site but then what? I’m still on the first part because I’m afraid to move on. When I was learning C++, I just read through without doing any examples and it took years of learning after those books to be able to make(start) a space shooter.
Advertisement
Do a couple of the exercises; and when I say do, i mean code it from scratch and run it. It's fine to look for syntactic reference, but don't look for code to cut & paste

-me
I have been programming for a long long time and I still look up things all the time. What you need to learn is the control structures (if, loops, ect) how to declare and use variables. In this case you need to learn how to get information from forms. Now to use built in functions (time, ect) feel free to look them up.

theTroll
The book doesn't give exercises, it only gives code and I can't compile the code separately because it all fits together as on application. For example the editentry.php page can't run without the $_Post data from the addentry.php page.

So it is ok to look stuff up, just not copying and pasting, ok gotcha.
Quote:Original post by Evil Booger
The book doesn't give exercises


Then make some up, and do them until you feel like you understand.
Take what the book tried to teach you, for example Post variables, and make your own 'demo' which is simpler than the one in the book. Instead of a blog, just make a simple demo which lets you type a name into a textbox on one form, then says "Hello Jim!" on a second form (a "Hello World" program essentially).
-----------------------------------------------“The best, most affordable way to save the most lives and improve overall health is to increase the number of trained local, primary healthcare workers.”Learn how you can help at www.ghets.org
The book will explain why you are doing things and what things do, but you shouldnt memorize it all after reading that one chapter, you will still need to look up stuff every once in a while, but the book is more of a guide. You will only memorize things more and more with time and practice.
i think the best way to learn programming in any language is to just program (of course you will need resources to look things up or find new concepts to include). sure you will end up making tons of mistakes at first, but as you work your way through them you will eventually be fluent.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Quote:Original post by Evil Booger
The book doesn't give exercises, it only gives code and I can't compile the code separately because it all fits together as on application. For example the editentry.php page can't run without the $_Post data from the addentry.php page.

So it is ok to look stuff up, just not copying and pasting, ok gotcha.


It's not that difficult. I have only started C++ for like 2 months, so I know how it goes. My book (Accelerated C++) does have exercises, but still I wanted more. I tried out everything I read in the book, because I found it interesting. What I'm trying to say is; it doesn't matter if there are no exercises in your book, because you can exercise yourself. Don't you have the feeling 'I want to try this too, how would it be?' when you read something. I'll try, compile and build it until it works, and that's the way it goes. You should make up your own exercises by practicing everything you read in the book, and don't read through it like it's a strip book.

Hope you can do something with this.

Regards.

This topic is closed to new replies.

Advertisement