On Frameworks, RoR & PHP

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
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

On Frameworks, RoR & PHP

Post by Jenk »

edit patrikG: Topic split from viewtopic.php?t=69524 for clarity
BDKR wrote:
Jenk wrote:
BDKR wrote: Checked out Ruby?
The creator of RoR admits Smalltalk and Seaside "is the standard by which all other frameworks are trying to achieve" or something to that effect. I do know that at a conference, he said "I defy anyone to come up here with their framework and create dynamic websites faster than we can. Except Avi" Where Avi is Avi Bryant, the creator of Seaside :)
Just make sure you aren't confusing the frameworks with the languages they're based on. :wink:
I'm not.
User avatar
Christopher
Site Administrator
Posts: 13595
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Jenk wrote:The creator of RoR admits Smalltalk and Seaside "is the standard by which all other frameworks are trying to achieve" or something to that effect. I do know that at a conference, he said "I defy anyone to come up here with their framework and create dynamic websites faster than we can. Except Avi" Where Avi is Avi Bryant, the creator of Seaside :)
Two problems: just because the creator of RoR admits something does not make it true, and "create dynamic websites faster" is one of many goals for frameworks -- and not the most important one in my book.
Last edited by Christopher on Tue Jun 26, 2007 3:11 pm, edited 1 time in total.
(#10850)
ev0l
Forum Commoner
Posts: 56
Joined: Thu Jun 21, 2007 1:50 pm

Post by ev0l »

arborint wrote:
Jenk wrote:The creator of RoR admits Smalltalk and Seaside "is the standard by which all other frameworks are trying to achieve" or something to that effect. I do know that at a conference, he said "I defy anyone to come up here with their framework and create dynamic websites faster than we can. Except Avi" Where Avi is Avi Bryant, the creator of Seaside :)
Two problems: jsut because the creator of RoR admits something does not make it true, and "create dynamic websites faster" is one of many goals for frameworks -- and not the most important one in my book.
I would agree with you but what is?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

arborint wrote:
Jenk wrote:The creator of RoR admits Smalltalk and Seaside "is the standard by which all other frameworks are trying to achieve" or something to that effect. I do know that at a conference, he said "I defy anyone to come up here with their framework and create dynamic websites faster than we can. Except Avi" Where Avi is Avi Bryant, the creator of Seaside :)
Two problems: just because the creator of RoR admits something does not make it true, and "create dynamic websites faster" is one of many goals for frameworks -- and not the most important one in my book.
So what is the point of frameworks, if not to remove the necessity to recreate common objects and decrease development time?
User avatar
Christopher
Site Administrator
Posts: 13595
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

ev0l wrote:I would agree with you but what is?
I think for me it is the ability to solve the most problems thrown at me in the cleanest way. I am willing to accept that solving simple problems may require a little more time or code than a straight PHP hack, but in turn I want to be able to solve complex structures, an Application Controller managing a series of dependent pages for example, without the torturous workarounds that many frameworks require once you are outside their capabilities. Perhaps you could call it consistency of implementation. Consistency begets maintainability -- which I will take over initial speed of implementation any time.
(#10850)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Most frameworks tend to be a straightjacket rather than a tool. Terry Chay recently mentioned in an extremely entertaining blog post scalability and the freedom to choose (RoR = Ruby on the web, PHP on the other hand is just PHP on the web, you can use frameworks, but don't have to - read the blog for background).
While I can't comment on scalability, there is much to be said about many frameworks' tendency to be the alpha and omega for web development - which they can't be.
Hence my perception of straightjackets and my wish for tools.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

arborint wrote: ...without the torturous workarounds that many frameworks require once you are outside their capabilities.
patrikG wrote: Most frameworks tend to be a straightjacket rather than a tool. Terry Chay recently mentioned in an extremely entertaining blog post scalability and the freedom to choose (RoR = Ruby on the web, PHP on the other hand is just PHP on the web, you can use frameworks, but don't have to - read the blog for background).
While I can't comment on scalability, there is much to be said about many frameworks' tendency to be the alpha and omega for web development - which they can't be.
Hence my perception of straightjackets and my wish for tools.
Wow you guys! I tend to agree completely with both of you.

As for the scalability of RonR, I'll say that it's pretty capable given some dead serious machinery to run it on. I did a short stint at PayPerPost.com and RonR performed very well under load. But even still, it's performance ceiling is going to be far lower then anything that's not
using an object relational mapper or persistence layer.

One of these days someone will get smart and write an OODB that can work with Ruby, PHP, Perl, and Python via a common object exchange interface.

Additionally, the RonR crowd seems to be pushing some screwy back end architectures. The fav being Mongrel with Apache to serve static content. They then mod_balance to load balance amongst n number of running instances of mongrel. While it runs, and runs well with good machines, it's a little more complex and therefore more delicate then how a Shared Nothing cluster in PHP may be implemented.

At least what I've seen from Code Igniter, there is a bit more flexibility in exactly how one can implement things. However, I was put off by how messy their example view looked. I'm also put off by (and this applies to RonR, and Cake as well) at just how much logic is actually placed in the controller. Is it just me or do these controller objects feel like the famous God Object anti-pattern.
User avatar
Christopher
Site Administrator
Posts: 13595
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think that frameworks should be building blocks that can be assembled in various ways (hopefully even those unexpected by the designers) to solve problems in a consistent manner. The more artfully the building blocks are designed -- the more solutions they solve cleanly. I think too many frameworks evolve, through pressure, into implementations of specific styles of solutions rather than supporting various styles of solutions. Take a look at the code monstrosity that is the current controller code in ZF or Cake or Symfony and you will see what I mean. CodeIgniter is lighter, but not by much. None are really at-will or mix-and-match.
(#10850)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

arborint wrote:I think that frameworks should be building blocks that can be assembled in various ways (hopefully even those unexpected by the designers) to solve problems in a consistent manner. The more artfully the building blocks are designed -- the more solutions they solve cleanly. I think too many frameworks evolve, through pressure, into implementations of specific styles of solutions rather than supporting various styles of solutions.
Couldn't agree more. Hence my earlier clamoring about Vincent Oostindie's Eclipse library. It was absolutely fantastic for PHP 4.x, as it just sped up the actual code implementation and made it consistent without being restrictive at all. With PHP 5.x some components (e.g. the db-wrapper) are outdated, but it still is, to me, the best framework around. But I'm speaking from a developer's point of view.

And most people are happy within the confines of a framework (e.g. CakePHP, Symfony, eZ etc. etc.). I'm not all too familiar with the Zend Framework, my perception of it is that it tries to be a Rails for PHP. The good thing about this is that PHP powers all that. I think the basic question most frameworks attempt to answer is: "how to best simplify PHP?" Since PHP is many things to many people, and hopefully stays that evolutionary, I believe that's its main strength.
User avatar
Christopher
Site Administrator
Posts: 13595
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

patrikG wrote:I think the basic question most frameworks attempt to answer is: "how to best simplify PHP?"
I think it may be time to start another framework design thread to hash over this idea in the post-ZF/RoR/Cake/Symfony/CI world of PHP. The design threads never produce anything worthwhile, but are always very enlightening to those involved.

I couldn't find anywhere to download Vince Oostindie Eclipse code ... do you have it so I could take a look at what you are talking about?
(#10850)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

It's at sourceforge http://sourceforge.net/projects/eclipselib/ - have a look and let me know what you think.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

patrikG wrote:It's at sourceforge http://sourceforge.net/projects/eclipselib/ - have a look and let me know what you think.
Yeah, that's pretty good stuff. It has (among other things) THE earliest implementation of an iterator I'd seen in PHP. It was a big influence on my coding.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

This thread is very interesting. I think I'm going to try out these things and report back.
arborint wrote:I think too many frameworks evolve, through pressure, into implementations of specific styles of solutions rather than supporting various styles of solutions. Take a look at the code monstrosity that is the current controller code in ZF or Cake or Symfony and you will see what I mean. CodeIgniter is lighter, but not by much. None are really at-will or mix-and-match.
I've said exactly the same thing myself on this very board. And it is the principle under which I am writing my framework.
User avatar
Christopher
Site Administrator
Posts: 13595
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

ole wrote:This thread is very interesting. I think I'm going to try out these things and report back.

I've said exactly the same thing myself on this very board. And it is the principle under which I am writing my framework.
I proposed a new Post-ZF/RoR framework design discussion thread were we can compare our designs with each others' frameworks and the leading frameworks to see if we can distill out improvements. If there is interest I will start a thread...
(#10850)
User avatar
Christopher
Site Administrator
Posts: 13595
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

patrikG wrote:It's at sourceforge http://sourceforge.net/projects/eclipselib/ - have a look and let me know what you think.
I remember that code. Besides the SPL-like library of classes there are really only basic database classes to the thing. It is really just a library and not a framework. I guess I am thinking more about PoEAA building blocks rather than GoF building blocks. It's the Controllers and MVC design that makes a framework a framework these days.
(#10850)
Post Reply