By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,732 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,732 IT Pros & Developers. It's quick & easy.

can any PHP framework match Ruby On Rails clarity of design?

P: n/a
I work mostly in PHP, but at the web design firm where I work we are
thinking of switching to Ruby on Rails. Our lead designer recently
installed Typo on a client's site and he said to us, with surprise,
"All Ruby On Rails software has the same directory layout?" That was a
revelation to him. He was used to the PHP scene, where diversity is the
rule.

I've done some google searches and I see that the subject has seen a
fair amount of conversation on comp.lang.php. Someone linked to this
list of PHP frameworks:

http://en.wikipedia.org/wiki/List_of...frameworks#PHP

Very comprehensive, but how does one figure out which ones are any
good? We have so far tested PHPCake, but the demo didn't work and none
of us liked it. We're feeling hopeful about the Zend Framework but
haven't had a chance to do anything serious with it.

So of all these frameworks, which are any good? And do any of them have
"Scaffolding" like Ruby on Rails does?

Dec 22 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
lawrence k wrote:
I work mostly in PHP, but at the web design firm where I work we are
thinking of switching to Ruby on Rails. Our lead designer recently
installed Typo on a client's site and he said to us, with surprise,
"All Ruby On Rails software has the same directory layout?" That was a
revelation to him. He was used to the PHP scene, where diversity is
the rule.

I've done some google searches and I see that the subject has seen a
fair amount of conversation on comp.lang.php. Someone linked to this
list of PHP frameworks:

http://en.wikipedia.org/wiki/List_of...frameworks#PHP

Very comprehensive, but how does one figure out which ones are any
good? We have so far tested PHPCake, but the demo didn't work and none
of us liked it. We're feeling hopeful about the Zend Framework but
haven't had a chance to do anything serious with it.

So of all these frameworks, which are any good? And do any of them
have "Scaffolding" like Ruby on Rails does?
codeigniter has "scaffolding" but whether it's like RoR I don't know,
never having used it. I use codigniter and have found it very easy to
start using and the documentation is very good.

http://www.codeigniter.com/

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Dec 22 '06 #2

P: n/a
lawrence k:
" <lk******@geocities.comwrote in message
news:11**********************@h40g2000cwb.googlegr oups.com...
>I work mostly in PHP, but at the web design firm where I work we are
thinking of switching to Ruby on Rails. Our lead designer recently
installed Typo on a client's site and he said to us, with surprise,
"All Ruby On Rails software has the same directory layout?" That was a
revelation to him. He was used to the PHP scene, where diversity is the
rule.

I've done some google searches and I see that the subject has seen a
fair amount of conversation on comp.lang.php. Someone linked to this
list of PHP frameworks:

http://en.wikipedia.org/wiki/List_of...frameworks#PHP

Very comprehensive, but how does one figure out which ones are any
good? We have so far tested PHPCake, but the demo didn't work and none
of us liked it. We're feeling hopeful about the Zend Framework but
haven't had a chance to do anything serious with it.

So of all these frameworks, which are any good? And do any of them have
"Scaffolding" like Ruby on Rails does?
You might want to check out this site: http://www.symfony-project.com. I'm
working my way through the very extensive tutorial "askeet in 24 days" and
finding it a great experience. One of the stand-out features of this
framework is the absolutely excellent and extensive documentation. My own
experience is limited but for me a lot of frameworks seem to fall down in
this area and it just too hard a slog to become productive.

To answer your query about scaffolding, here is the relevant url:
http://www.symfony-project.com/book/trunk/generator. Good luck with finding
a productive and enjoyable web framework.

Regards,
Ian
Dec 22 '06 #3

P: n/a

lawrence k wrote:
I work mostly in PHP, but at the web design firm where I work we are
thinking of switching to Ruby on Rails. Our lead designer recently
installed Typo on a client's site and he said to us, with surprise,
"All Ruby On Rails software has the same directory layout?" That was a
revelation to him. He was used to the PHP scene, where diversity is the
rule.
As a follow up question, I might ask whether any one knows of designer
experiences with any of the PHP frameworks. In our shop, the designers
have had a positive experience with Ruby On Rails. They've had negative
experiences with a number of PHP software projects, such as Phorum and
phpBoard and some eccomerce suites.

The criticism of the PHP software projects tends to include two points:
1.) either the HTML includes tables

2.) the template system is difficult to figure out.

With Ruby On Rails, I've heard our designers say 3 positive things
about:

1.) all software packages have the same directory structure

2.) The template language is easy to read and intuitive

3.) Conditional statements are in the template, so the designer can
easily figure out what conditions effect what partials get rendered.

Of these, #3 was the biggest surprise to me. I did not think designers
would enjoy seeing conditional statements, but apparently the enjoy it
much more than they enjoy this:

<?php include($theFile); ?>

If they have to modify the file that is referenced by the variable
$theFile, the above line presents them with a headache, as they do not
necessarily know what sorts of conditions set the variable $theFile
with what value. It is too much for them to figure out. Surprisingly,
they prefer to see this:

if ($_GET["category"] == "hammers") {
include("hammers.htm");
} else {
include("saws.htm");
}

Throughout the web design industry computer programmers are often
valued more than designers. Although top designers are usually paid as
much as computer programmers, production assisstants, who do lower
level build out and CSS work, get paid much less, on average. So, for
economic reasons, it's important to find a framework that shifts as
much work as possible from the programmers to the production
assisstants. I imagine most professional web design shops face the same
situation (a fact which causes me to wonder why a single framework
hasn't become standard for PHP web design).

It is curious that Ruby on the web is synonymous with a single
framework, whereas in the world of PHP, no framework has managed to
gain much market share. I wonder why that is? It helps that Ruby on
Rails was so perfectly done and contains so many best practices (no
HTML embedded in the code, for instance). I think it is probably also
helped by being new. Some of the worst things that people associate
with PHP (the use of HTML tables in templates) is merely a product of
the age of some of PHP's better known software products (newer
projects, like WordPress, don't suffer the same flaws).

I guess the Zend project was probably started as a PHP alternative to
Ruby on Rails?

Dec 23 '06 #4

P: n/a
As a follow up question, I might ask whether any one knows of designer
experiences with any of the PHP frameworks. In our shop, the designers
have had a positive experience with Ruby On Rails. They've had negative
experiences with a number of PHP software projects, such as Phorum and
phpBoard and some eccomerce suites.

It is curious that Ruby on the web is synonymous with a single
framework, whereas in the world of PHP, no framework has managed to
gain much market share. I wonder why that is? It helps that Ruby on
Rails was so perfectly done and contains so many best practices (no
HTML embedded in the code, for instance). I think it is probably also
helped by being new. Some of the worst things that people associate
with PHP (the use of HTML tables in templates) is merely a product of
the age of some of PHP's better known software products (newer
projects, like WordPress, don't suffer the same flaws).
As I follow up to that, I might add my biggest complaint against Ruby
On Rails: a computer programmer is needed to install it. As I mention
above, an ideal framework, for us, would maximize what designers can do
without programmers. The designers are generally paid less than the
programmers, so economics suggests we need to maximize the scope of our
designers. A framework that empowers designers (by covering or
automating some of the most complicated bits of setting up a framework)
would be very useful to us.

At several design shops where I've worked, the programmers are always
busy, whereas the production assisstants sometimes have time on their
hands. Sometimes the production assisstants are waiting for the
programmers to get done with something, so they can move forward. This
is lost money.

The worst crime against productivity that I've seen is when HTML gets
embedded inside of PHP code. Then programmers are needed to do such
important tasks as change a <STRONGtag to <EM>. Economically, this is
the same as shoveling money into a fire pit and striking a match.

As my company evaluates PHP frameworks, a big question for us is which
framework maximizes what the designers can do. We would love to hear
from designers who've had experience with some PHP frameworks, or
programmers who know the reactions of designers to some of these
frameworks.

Dec 23 '06 #5

P: n/a
NC
lawrence k wrote:
>
I work mostly in PHP, but at the web design firm where I work
we are thinking of switching to Ruby on Rails.
This is well and good, but have you (or anyone else, for that matter)
tested it in a production environment? This is not to start a flame
war; I am sincerely interested...
Very comprehensive, but how does one figure out which ones
are any good?
None. The best framework is no framework. Frameworks help
developers quickly and cost-effectively (with "cost" meaning
"development cost" rather than "total cost of ownership") develop
resource-hogging software, so they should be avoided in all
instances where performance and scalability are important.
In the same vein, if you absolutely have to have a framework,
you should consider implementing it as a PHP extension...

Cheers,
NC

Dec 24 '06 #6

P: n/a
"NC" <nc@iname.comwrote in message
news:11**********************@i12g2000cwa.googlegr oups.com...
lawrence k wrote:
>>
I work mostly in PHP, but at the web design firm where I work
we are thinking of switching to Ruby on Rails.

This is well and good, but have you (or anyone else, for that matter)
tested it in a production environment? This is not to start a flame
war; I am sincerely interested...
>Very comprehensive, but how does one figure out which ones
are any good?

None. The best framework is no framework.
I disagree. A framework, such has been built yourself from previous
projects, will always save time and money by not having to rewrite (and
debug) what has been written before.
Frameworks help
developers quickly and cost-effectively (with "cost" meaning
"development cost" rather than "total cost of ownership") develop
resource-hogging software, so they should be avoided in all
instances where performance and scalability are important.
In the same vein, if you absolutely have to have a framework,
you should consider implementing it as a PHP extension...
But if performance and scalability are NOT important then a good framework
could save you a fortune in developer costs. RoR was specifically designed
to reduce developer cycles, not cpu cycles, so it is not designed for
performance and scalability. If you are building an administrative web
application and not a common-or-garden web site then take a look at Radicore
at http://www.radicore.org This has a data dictionary with code generation
abilities, dynamic menus, role based access control (RBAC), in-built audit
logging and viewing without database triggers, an activity based workflow
system, facilities for internationalisation, and the capability to generate
PDF documents. It works with MySQL and PostgreSQL, with an Oracle driver in
the pipeline.

Check out http://www.tonymarston.co.uk/php-mys...re-vs-ror.html for a
comparison with RoR

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org

Dec 24 '06 #7

P: n/a
NC
Tony Marston wrote:
"NC" <nc@iname.comwrote:
The best framework is no framework.

I disagree. A framework, such has been built yourself from previous
projects, will always save time and money by not having to rewrite
(and debug) what has been written before.
But you don't need a framework for that. A well-structured code
repository will work just as well... Take what you need for
production,
leave the rest in the archives...
Frameworks help developers quickly and cost-effectively (with
"cost" meaning "development cost" rather than "total cost of
ownership") develop resource-hogging software

But if performance and scalability are NOT important then a good
framework could save you a fortune in developer costs.
Agreed. Conversely, if performance and scalability ARE important,
then the use of a framework during development would make a rather
large hole in your operating budget; you will end up using way more
dedicated boxes than you could have gotten away with if you steered
clear of frameworks...

Cheers,
NC

Dec 26 '06 #8

P: n/a

Tony Marston wrote:
"NC" <nc@iname.comwrote in message
news:11**********************@i12g2000cwa.googlegr oups.com...
lawrence k wrote:
Frameworks help
developers quickly and cost-effectively (with "cost" meaning
"development cost" rather than "total cost of ownership") develop
resource-hogging software, so they should be avoided in all
instances where performance and scalability are important.
In the same vein, if you absolutely have to have a framework,
you should consider implementing it as a PHP extension...

But if performance and scalability are NOT important then a good framework
could save you a fortune in developer costs. RoR was specifically designed
to reduce developer cycles, not cpu cycles, so it is not designed for
performance and scalability.
I may regret this and I may later change my mind, but I think I agree
with the point Tony Marston is making here. The vast majority of our
clients have very low traffic sites. Saving development time, rather
than CPU time, is good economics. If someone writes us a check for
$10,000, for a site we can build in either 2 or 3 weeks, then, for us,
building it in 2 weeks is preferable to building the site in 3 weeks,
even if the site built in 3 weeks would be more efficient in terms of
CPU performance. The extra week of development might cost us $2,000, so
it would take a great deal of CPU demand before we'd earn back that
money. None of our current clients have the kind of traffic that would
make that $2,000 a sensible expenditure.

I could be wrong about this though. I have not considered the
counter-arguments or the long term costs.

Dec 28 '06 #9

P: n/a

NC wrote:
In the same vein, if you absolutely have to have a framework,
you should consider implementing it as a PHP extension...
That is the attitude taken by the Ruby On Rails crowd. After a project
launches, they profile it and if a part of the code is very CPU
intensive, they rewrite in C. David Heinemeier Hansson, in a recent
interview, talked about rewriting a bottleneck in C, to get better
performance than what he was getting in Ruby:

http://www.infoq.com/interviews/David-Hansson

"We built up the entire Campfire system without really worrying about
scalability. Then the day came when we were actually done with the
system, when we had the system that we wanted to launch, and then we
needed to care about scalability. So we started to do stress testing,
we started running performance benchmarks and we realized that the
initial setup we had was just not fast enough. Step one was adding
caching in Rails. ... If you can cache, your execution can be as slow
as you want, as long as you can do it with cache and cache hits are
high enough, you're totally fine. But in our case we (eventually) did
feel the need to make something faster, so we looked at the Campfire
application. Where was the bottleneck? Where were we having issues or
issues that were going too slow? We found that bottleneck and that
bottleneck was a hundred lines of Ruby code. The responder to that poll
"Did I get a new message, Did I get a new message" The guy who
responded to that question was a bottleneck, a hundred lines of Ruby
code. ...We could easily do millions of requests per day, just because
we have all these people asking "Did I get a new message?" So we chose
to rewrite those hundred lines of Ruby code, to see what it would take
to write it in the fastest language we can rewrite it in; we didn't
rewrite it in assember, but we rewrote it in C, a fantastic language
for rewriting performance bottlenecks. So we rewrote a hundred lines of
Ruby code into three hundred lines of C, in about 3 hours. The great
part was that we had already done all the locking, we already had a
completely working system, we had already specified all of the behavior
in Ruby, so we were not exploring anything in C, we were just
translating lines pretty much, asking "How do we make this Ruby line
into C and make it reasonably fast". We still have the Ruby version so
when you look at the Ruby version and you look at the C version, you
see that they roughly do the same thing. Ruby does it a lot more
eloquently, in a lot less code, and with a lot less mental overhead.
The C version does roughly the same, it's just a lot faster. It's
hitting the database: two requests per question, one request for
permissions and one request to see if you got something new. But since
we cache, those requests are stupidly cheap to make. So even though we
could have said: "This is not even going to scale, we've got the poller
in C, but we're still hitting the database so it's still too expensive"
then the next option was right there for us. If the database were not
fast enough, memcache would be the next obvious step; and that's going
to scale definitely too. So we just haven't moved down the path yet,
but it's there..."

Dec 28 '06 #10

P: n/a

NC wrote:
lawrence k wrote:
Very comprehensive, but how does one figure out which ones
are any good?

None. The best framework is no framework. Frameworks help
developers quickly and cost-effectively (with "cost" meaning
"development cost" rather than "total cost of ownership") develop
resource-hogging software
That may be a valid criticism of frameworks, if what you're trying to
say, via some hyperbole, is that most frameworks are really bad. I
agree with you that most frameworks are bad, and most frameworks use
too much in the way of resources. But that is why I posted a question
to comp.lang.php. What I'm asking is which frameworks are good? And
part of that answer should include "Uses resources economically." But
then, it doesn't need to be too economic, for reasons I explained in my
last post.

Personally, I've been working on a framework that is minimalist in its
resource use. However, given the large number of open-source frameworks
out there, I question why I should be doing the work that I'm doing.
I'm probably just redoing work that someone else has already done in
some open source project somewhere. My problem is finding that open
source project.

Dec 28 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.