On Tue, Jun 9, 2009 at 3:01 AM, s.ross<[email protected]> wrote:
> On Jun 8, 2009, at 11:37 PM, Zayd Connor wrote:
>
> Why are there more web design users using PHP instead of using Rails? Is
> there an advantage using PHP over Rails?
>
> Thanks
>
> I'll restate the obligatory: PHP is a language; Ruby is a language; Rails is
> a Web App framework. So...

However, they are very different kinds of language.

PHP basically starts with HTML and adds syntax to add logic.

Ruby starts as an object oriented programming language and adds
library code to produce html and other stuff.  Ruby provides powerful
features to aid modularity and the implementation of domain specific
language extensions which can be implemented just with Ruby code.

A more direct comparison would be between PHP and erb, which embeds
logic written in Ruby within HTML.

Many people starting out may find that PHP is easier since you can
start with HTML, and add a little UI logic, and a little database
access right there.

The problem is that, as your application grows, you can quickly end up
with a complex beast which is hard to understand and maintain.

I've seen too much PHP code which has reached this point, and I've
turned down a few consulting gigs which would have involved living
with that.

It's possible to write nice modular maintainable PHP code.  One good
example, at least the last time I looked at it, is mediawiki which is
the engine behind Wikipedia.  But it takes a certain expertise to
start out, and a lot of discipline to keep the code under control.

The advantage of Rails is that you start out with a nice modular
maintainable structure, and as long as you don't fight it, your code
will stay in a "better place."

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to