QuickTopic (SM) free message boards QuickTopic (SM) free message boards
Skip to Messages
  Sign In to access your topic list  |New Topic |My Topics|Profile
Upgrade to Pro   Customize, show pictures, add an intro, and more:   QuickTopic Pro...and check out QuickThreadSM
Topic: Well designed PHP applications
Views: 3481, Unique: 1441 
Subscribers: 3
What's
this?
Printer-Friendly Page
Subscribe to get & post, or stop messages by email Subscribe
All messages    << 11-26  1-10 of 26        
About these ads
Who | When
Messagessort recent-top   
Post a new message
 
Sanjay Sheth  1
11-23-2004 09:22 AM ET (US)
Wordpress is considered to be one of the better php codebases out there. http://wiki.wordpress.org/

Also, I've found that doing random searches for a particular api call, etc. on koders.com turns up some interesting sample code and open source projects.
Jason Levine  2
11-23-2004 09:31 AM ET (US)
I've found that SquirrelMail is pretty good, both from an interface design standpoint (OK, it uses frames, but in a well-designed way) and a code design standpoint.
Simon Willison  3
11-23-2004 09:39 AM ET (US)
That really is the million dollar question; I have yet to see a PHP codebase that I really like and that includes the one's I've worked on. I find that language features such as magic quotes and the unfortunate lack of module-style namespace support make it very hard to write large PHP code bases that are aesthetically pleasing.

That said, I think an example of a pretty decent overall PHP project is the PHP.net site itself; you can browse the source online here: http://cvs.php.net/phpweb/

In my experience, it's very easy to fall in to a trap of over-engineering PHP applications by trying to construct "clever" class hierachies and use OOP to encapsulate things left right and center. KISS definitely applies.

I'd love to see an example of a large, well architected PHP application that uses OOP in a smart way. Please blog about it if you find one!
Sencer  4
11-23-2004 10:23 AM ET (US)
Wordpress? Are you serious? I used to use (and hack) b2 from which wordpress evolved, and unless they have done really a lot of refactoring (rewrite?) I would not describe the codebase as exemplary. I used to appreciate b2 for it's simplicity and as a starting PHP-programmer it was easy to add and change stuff, but of course this style can become a disadvantage very quickly.

I have to agree with Simon, there really isn't one application that I could point to, for which all aspects are great. I think due to the wide variety of "styles" that PHP allows, I've seen developers going from one extreme (spagetthi-procedural) to the other extreme (massive pattern-overdose).

Rafe, are you looking for "sensible hyprid" (mixed OO and non-OO) approach, or are you looking for OO-only software? Do you think the templating should be done in PHP (e.g. savant), or in a custom-made mini-language (e.g. smarty)? Would you prefer a software that relies heavily on "external" libraries provided by other php-projects used in a black-box approach, or do you think that software which re-invents things in way which fits best for the current project?

There really are several dimensions along which to measure, and everybody seems to view a different Combination and different direction of them as "top".
Patrick BerryPerson was signed in when posted  5
11-23-2004 10:54 AM ET (US)
Edited by author 11-23-2004 10:58 AM
I like Smarty (template engine) and Horde (app framework). One that I've been meaning to look into more is Mojavi (a model-view controller). I use a fair amount of PEAR, but I wouldn't exactly know which module to point you to for "good code."

You might also want to peruse Zawodny's PHP Archives, as he talks not only about php, but php in use at Yahoo.

Being a big unit testing fan, you might also want to take a peek at Simple Test for PHP
Quillian Rutherford  6
11-23-2004 11:04 AM ET (US)
Php is a functional language with object-oriented constructs, you should be writing it just like other code you write. In fact, you should be able to take a piece of paper, write psuedo-code, and implement that almost exactly the same in any language like PHP (C++, Perl, etc). Although PHP lends itself to quick and dirty coding due to be loosely typed and flexible, there is no reason you have to write it that way.
I actually did an algorithms project in PHP because it was very easy to write it fast, I just wrote all my functions and code, then went to phpbuilder.com and looked up the correct syntax. Maybe that's just how I do things, though.
rafecoPerson was signed in when posted  7
11-23-2004 11:21 AM ET (US)
I haven't done any OO in PHP at all, and don't really plan to. I have a Java application and a PHP application that I work on, and I try to move anything seriously complicated to the Java side of things, where I understand better how to design things.

On the PHP side, I'm thinking of the most basic stuff, like dividing up logic and presentation. I'm not doing anything content management related -- it's more forms processing, and I'm just making something called foo.php and foo_logic.php so that the only thing in the main page, foo.php that's not presentation related is an include of the logic page, which only has nothing but PHP code in it.
jim winstead  8
11-23-2004 11:58 AM ET (US)
i'm partial to our open-source (GPL) issue-tracking product: eventum. very clean code. (and i say that not as someone who wrote any of the code.)
kellan  9
11-23-2004 12:42 PM ET (US)
WordPress, SquirrelMail, and Horde, all of these applications work great, but Rafe's question was about coding *style*.

WordPress for example, as much as its nice to hack on, is a mess of global variables, implicit actions, and display logic squirreled away deep in methods.

Smarty is clean enough, but it is much simpler to write clean looking libraries then clean looking apps. In that vein, I found the Seagull (a framework) code pleasing to read, though I haven't actually used it.

Rafe of course you're confusing things because you asked for well designed in one breath, and then said "but no objects", maybe I'm showing my biases here, but that sounds like a contradiction to me :)

Best practices are:

      
  • use PEAR
      
  • use PHP5 if you can get away with it (better objects and exceptions)
      
  • use some sort of template system (Savant, Smarty, Flexy, etc)
kellan  10
11-23-2004 12:48 PM ET (US)
ick. sorry about the weird spacing on that last message.

btw. jim, from looking at eventum for 90 seconds it does look nicely written. i prefer a more explicit FrontController approach, but nice separation of logical components without a lot of framework baggage,
RSS link What's this?
All messages    << 11-26  1-10 of 26        
QuickTopicSM message boards
Over 200,000 topics served
Learn more Frequently asked questions  Acknowledgements
What they're saying about QuickTopic
 Questions, comments, or suggestions? Contact Us
Read our use policy before beginning. We value your privacy; please read our privacy statement.
Copyright ©1999-2008 Internicity Inc. All rights reserved.