The Joel on Software Discussion Group (CLOSED)

A place to discuss Joel on Software. Now closed.

This community works best when people use their real names. Please register for a free account.

Other Groups:
Joel on Software
Business of Software
Design of Software (CLOSED)
.NET Questions (CLOSED)
TechInterview.org
CityDesk
FogBugz
Fog Creek Copilot


The Old Forum


Your hosts:
Albert D. Kallal
Li-Fan Chen
Stephen Jones

PHP vs Ruby on Rails

I know php/mysql but not Ruby. What are the pros and cons of these two?

Constraints? I guess basically a db-driven website; built with php/mysql vs the Ruby equivalent

Apart from that, open slather - IDE, the full SDLC...

tia
Philip Prohm Send private email
Friday, June 17, 2005
 
 
php is a mess, both the language and the environment

ruby is not

rails isn't either
Jonathan Ellis
Saturday, June 18, 2005
 
 
and since the last time this came up (last week) the resident [php] fanboys called me out, I set down some specifics:

http://spyced.blogspot.com/2005/06/why-php-sucks.html

I expect the usual "all I know is PHP and it works fine for me" replies.
Jonathan Ellis
Saturday, June 18, 2005
 
 
Slagging is lame. If Ruby has pros, enumerate them.
Philip Prohm Send private email
Saturday, June 18, 2005
 
 
Most hosts support PHP.

Almost none support Ruby.

PHP is very C-ish in syntax.

Ruby has as awkward, foreign syntax.


PHP is a mess, yes, but you can get things done, which is all that matters.

Saturday, June 18, 2005
 
 
I like Python. Ruby has too many syntactic elements for my taste. I haven't tried any Python-friendly hosts, but TextDrive and python-hosting.com both look professional and have good prices. There is a Rails-ish framework for Python called Subway that I've been planning to try.

http://subway.python-hosting.com/

There are a number of alternatives. But if you want something now, it's probably best to used an established web programming language with a familiar syntax, and that is PHP.

I learned PHP/MySQL and made a site for a friend in three days.
Ben Atkin Send private email
Saturday, June 18, 2005
 
 
"Ruby has as awkward, foreign syntax."

If by "awkward" and "foreign" you meant "clean" and "elegant", then you're absolutely correct.  It's not fair to blame a syntax just because you're not used to it.
RubyIsAllHype
Saturday, June 18, 2005
 
 
"Most hosts support PHP. Almost none support Ruby."

This is a nonsense argument.

If you have a host, then all you care about is whether YOUR host supports Ruby or not. If you don't have a host, then finding one that supports Ruby is easy: Google for "ruby web hosting".
Brad Wilson Send private email
Saturday, June 18, 2005
 
 
"Most hosts support PHP. Almost none support Ruby."

There is one solution that always works: VPS.
Pythonic Send private email
Saturday, June 18, 2005
 
 
Caveat: I haven't used either in a production environment.

PHP is a language, Rails is a framework.  To some extent, you're asking us to compare apples and oranges.

Comparing languages, Ruby is a general-purpose language with a lot of influences from Smalltalk, Perl and other dynamic languages.  PHP is a special-purpose language and, although it has improved a lot over the years, it still doesn't lend itself to the full range of object-oriented programming that Ruby does.

Your stereotypical PHP site is a bunch of pages glommed together, a big ball of mud held together with goto statements.  That works up to a point.

Rails really lives up to the name of a framework.  You ask it to generate a skeleton application and customize it as necessary.  It encourages you to follow some fairly well-known patterns, such as model-view-controller (MVC) and Active Record.  Rails uses a number of conventions, so that if you know one Rails application, it should be fairly easy to understand the next one you come across.  Hence, Rails has advantages when it comes to testing, making changes or adding features.

Rails also has canned solutions for a lot of common requirements.

Not that you can't do a lot of this with PHP -- it's just that Rails is designed to support its approach so that it's the natural way to do things.
Christian Murphy Send private email
Saturday, June 18, 2005
 
 
PHP is a language, Ruby on Rails is a web application framework.

Why don't you like Ruby?

What I like about it: blocks, no need to use parens on method calls (if unamibious, which is almost always), no need to put semicolons, good regular expression support.
Joseph Huang
Saturday, June 18, 2005
 
 
Also, see the previous topic on Ruby on Rails: http://discuss.joelonsoftware.com/default.asp?joel.3.146997.11
Joseph Huang
Saturday, June 18, 2005
 
 
My main reservation about Ruby and Rails is the new-ness. A language like Perl has had so many issues thrown at it over the past decade or more that, yes it sometimes looks like an awful mutant, but it also has CPAN. It's sort of like Joel's saying that "code doesn't rust." Old code may look gnarly, but that's in part to work around bugs out there in the real world. Ruby and Rails looks great and shiny but in part that it is because it is young and virginal.
Ryan
Saturday, June 18, 2005
 
 
PS On the other hand Rails is a pioneering Web rapid deplyment framework -- even Perl didn't have anything comparable until recently -- so in that sense it is actually more mature than other languages. But when you get into the specific things you want to do with your Web app (beyond generic content management, chat or online store) it is comforting at least to me to have lots of libraries to draw from.
Ryan
Saturday, June 18, 2005
 
 
For those whose main argument in favor of PHP is its C-ish syntax: Wow.

PHP is a disaster.  Look past the syntax and towards orthogonality and extensibility.  I prefer Python myself, but you could do a lot worse than Ruby.
Jonathan Ellis
Saturday, June 18, 2005
 
 
PHP is infinitely extensible. Sure, it's an abortion, but it's soo damn easy to get things working.

Ruby? Well, show me one large site written in Ruby.

Saturday, June 18, 2005
 
 
what is the disaster that is php? Other than personal preference and some trivial to work around issues mentioned on your blog, do you have concrete issues with php? Real sites can be written and written quickly in php.

Can the same be said for ruby? So CRUD (create/read/update/delete) from forms to database is easy and builit in. That is not what makes an app complex. Kind of implies that it makes it easy for novices. The question is, can you do non-trivial things easily as well? Can you easily get around the framework when it doesnt do what you need?
hype or useful
Saturday, June 18, 2005
 
 
PHP is truly horrific - a badly-thought-out cumulative mess of a language.
I say this as someone who's had to write quite a bit of complex web software in it. Not fun. Not even slightly.

Ruby I am just starting to learn but seems very nice and elegant, if you can forgive a few minor warts.

Sorry too lazy to go into details, but the article above on why PHP sucks pretty much sums it up.
Matt
Saturday, June 18, 2005
 
 
Web apps written in Ruby on Rails:
Tada Lists - online to do lists: http://www.tadalist.com/
Basecamp - online project management: http://www.basecamphq.com/
Instiki - an easy-to-install wiki engine: http://instiki.org/show/HomePage
Typo - for blogging: http://typo.leetsoft.com/
Joseph Huang
Saturday, June 18, 2005
 
 
Backpack - personal information management: http://www.backpackit.com/

What exactly do you mean by 'large'? Are you trying to say if it's not 'large' it's no good?
Joseph Huang
Saturday, June 18, 2005
 
 
Get around the framework? What for?

The framework imposes the model, view, and controller design pattern, and that's about it. You can use ActiveRecord to communicate with a database for data persistance, but that is optional.
Joseph Huang
Saturday, June 18, 2005
 
 
"The question is, can you do non-trivial things easily as well? Can you easily get around the framework when it doesnt do what you need?"

I'd say yes.  To me, Ruby on Rails is what Cocoon could have been and so much more (no XML, less restrictive framework).

The defaults that the Rails framework imposes to speed up development can be customized. As well, you can configure one-off style controllers to handle requests that don't otherwise fit into the Rails paradigm easily.

The definitive answer to anyone's questions will, of course, be to sit down and play with the framework.  May I suggest Agile Web Development with Rails, by Dave Thomas, as introductory reading? (link: http://www.pragmaticprogrammer.com/titles/rails/)
Colin Dellow Send private email
Sunday, June 19, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz