Can you recommend any oop php scripts for me to study?

Hi everybody. I am new to this site. I have been teaching myself how to program in PHP and MySQL. I have gotten to the point where I am comfortable with defining classes and methods and things like that. However, I am still confused when it comes to taking these individual pieces of code and getting them to work together to create a functioning website. I figure a good way to start learning about this is to download and study open-source scripts. Can anybody recommend any high-quality scripts for me to study study?

Have a look at “The Art of Unix Programming” it’s not just for unix, it talks an awful lot about good program design. (and it’s a free online book :slight_smile: )

I’d probably study some python/java and others (this stuff takes years… don’t get discouraged!)

Although usually impractical for smaller websites, java is a good place to see how they’ve done huge projects (or in many cases… taken simple projects and over-bloated them… so sometimes it’s a good example of what NOT to do! :-/ )

Python is sort of a “purist” comp-sci kind of language, good solid designs in the official python sites. (alas, I seldom get the chance to actually use python…)

Perl… books are good for learning, but if you look at code, not so much… as in, really “not so much”

The reason is, these things will show how they’ve put pieces together in other languages and you can see the parallel to PHP.

PHP is often a sort of the “git-r-done” (in trailor-park parlance) language. Not generally a good place to learn about programming, it is effective within that domain however.

Hi Jasdohe07,

Welcome to the Sitepoint Forums!

Can anybody recommend any high-quality scripts for me to study study?

First of all, don’t take any scripts directly to study. Read some articles or books that describes about OOP and go through the examples. That will be durable as far as I know.

There are many books available (some free tutorials can be found for quick learning though) online. Buy one of the books that you think good for you according to your knowledge and go ahead.

http://www.google.com/search?q=OOP+php5+book

I would suggest you learn from a more experienced source. These are the books I’d recommend:

1st: http://foundationphp.com/pos/

Or if you are experienced with PHP:

PHP Objects, Patterns, and Practices - http://apress.com/book/view/143022925X

The second book has a large amount of content (theory) but good patterns that will be essential to good object-oriented code.

Open source and quality source are a very rare sight. Best of all start your own project and learn by doing it. How do you know you’re doing it good? You can add new features to your application very easy and you don’t scratch your head when reading the code 2 weeks after you wrote it