Know the basics, where to go from here?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
basudz
Forum Newbie
Posts: 9
Joined: Tue Dec 01, 2009 7:57 am

Know the basics, where to go from here?

Post by basudz »

I'm new to the LAMP stack and have been working with it professionally now for a little over a month. I'm a junior level programmer still and my foundations are from C++, Java, and .Net(asp.net & C#). I've picked up PHP & MySQL very quickly and work on some pretty heavy object oriented existing applications that were written prior to my employment.
The application I work on is a completely dynamic database driven system..It was built years ago by the owners son that had no coding experience or education and learned as he went. It's surprisingly complex but the code and organization are simply just ugly..There is no way to rebuild the system from scratch with proper patterns and practices because it is too large and the time and money it would take to do so would not be agreed upon.

I feel that I have a good grasp on the language and wonder where I should focus my attention to start learning the more advanced concepts that will improve my coding practices and efficiency. I've thought about learning the MVC pattern in PHP, or picking up one of the many frameworks to get my hands dirty with..Maybe I should be getting acclimated with PEAR or PECL?

What do you guys suggest I should take up next?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Know the basics, where to go from here?

Post by Eran »

Patterns (incl. MVC) + frameworks is the way to go
basudz
Forum Newbie
Posts: 9
Joined: Tue Dec 01, 2009 7:57 am

Re: Know the basics, where to go from here?

Post by basudz »

Are there certain frameworks recomended to start out learning before others?
As far as patterns go, are there certain ones that tend to be more popular and used more frequently then others that I should focus on?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Know the basics, where to go from here?

Post by Eran »

If you're serious, you should probably read the book "Design Patterns: Elements of reusable object-oriented software" for a comprehensive overview of the most basic and common patterns. You will not find MVC in there, but most frameworks use many of those basic patterns in almost every aspect. Then you should probably read refactoring, as it will improve your attitude on how to maintain and evolve code (and probably an insight on how to improve your legacy system).

Regrading frameworks, it's more of a personal preference and everybody has their favorite. You can't go wrong with either of the top frameworks, such as Zend Framework, CakePHP, Symphony etc. The only framework I would personally recommend against would be code-ingniter (though I know there are many advocates to it here), as it does not follow modern PHP conventions and overall its structure is not up to par with the other frameworks.
basudz
Forum Newbie
Posts: 9
Joined: Tue Dec 01, 2009 7:57 am

Re: Know the basics, where to go from here?

Post by basudz »

I've been looking into design pattern books and I know that Design Patterns: Elements of reusable object-oriented software is essentially the bible, but I was wondered if it may be more to my advantage to pickup a recently published design patterns book that's strictly focused on PHP? eg. Professional PHP Design Patterns (Wrox Programmer to Programmer)

Or perhaps even both would compliment each other and help significantly in my current position? I enjoy coding very much as a profession and a hobby, and I don't want to be just another PHP guy. My lack of experience in the field though has my pathway clouded a bit lol, so parden some of my questions that may have obvious answers.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Know the basics, where to go from here?

Post by Eran »

I would start with the original Design Patterns book unless someone has a better recommendation to something more modern. From there get started with a framework - all those patterns would start become clearer once you see them implemented with real code (most of the frameworks do a very nice jobs of implementing the various patterns). Refactoring is also very important, so pick up the book if you haven't already. There's also "Patterns of enterprise applications" by the same author (Martin Fowler) which covers more modern patterns (including MVC) and is very much recommended.
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: Know the basics, where to go from here?

Post by JNettles »

You might also want to take a crack at putting together your own MVC framework. Its an invaluable experience that you learn a lot from even if it will never come near a production-level environment. It can a good lesson in learning how the larger frameworks behave.

For example, I really didn't understand how sef rewriting worked until I sat down and wrote one myself.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Know the basics, where to go from here?

Post by Luke »

I recommend you pick up this book: "http://www.amazon.com/PHP-5-Objects-Pat ... 1590593804". It's fantastic. The other books that were recommended are great for learning Design Patterns in general, but this book actually describes all of the complexities of working with Design patterns and tools for PHP5 specifically.
basudz
Forum Newbie
Posts: 9
Joined: Tue Dec 01, 2009 7:57 am

Re: Know the basics, where to go from here?

Post by basudz »

I checked out the PHP 5 Objects, Patterns, and Practice book and actually found a 2nd edition published only a couple years ago that I have decided to with. There's also a 3rd edition to be released in May this year. I'm still looking into the refactoring and some other books about frameworks and the various other PHP tools that I have yet to explore.

Thanks for all the advice and direction!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Know the basics, where to go from here?

Post by Luke »

Oops. glad you noticed that. I meant to send you a link to the second edition. I didn't know there was a third edition on the way. I loaned out my 2nd edition version and I doubt I'll ever see it again, so I'll have to pick up the 3rd edition when it comes out. Thanks :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Know the basics, where to go from here?

Post by josh »

Test Driven Development by Example By Kent Beck
Post Reply