Can RoR do everything that PHP can do?

I used to build my sites with PHP and now I using rails and what I can say to you is that as far as today I never ran into something that I couldn't do with ror, imho rails is more complete than PHP and it is way easier and faster to program.

I should have no problems without PHP.

Thiago

This is the wrong question to ask because you’re trying to compare a language (PHP) with a framework (Rails). Rails makes web development easier, in the Ruby language. If you want a proper comparison, go with CakePHP vs Rails, though that’s also hard to do because Cake is in most accounts a port of Rails to PHP.

As for mixing PHP code in with a Rails app, it is possible but it’s in no way easy and definitely not recommended. Besides, running PHP means you don’t get any access to the Rails environment.

Jason

Maybe a better comparison would be RoR and symfony (symfony-project.com) ?

Probably because the OP specifically mentioned PHP? :slight_smile:

Shandy,

I have developed in PHP off and on for the past few years. I've
never done it full-time and I would not call myself a guru.
Competent, yes. About a year ago, I was contracted to work on some
PHP code part time, on a regular basis. I like PHP. Then in the
spring of this year, I decided that I wanted some sort of framework
for developing my own applications, so I started researching. I
don't know why, but I didn't come across any of the PHP-based
frameworks. All I found that were serious contenders *for me* were
TurboGears (Python), Django (Python), and Rails (Ruby). So the first
thing I had to do was decide if I wanted to code in Ruby or Python,
and since I didn't know either, it was a pretty fair comparison. I
did some reading, did some experiments, and decided that I liked Ruby
better. That "forced" me to choose Rails.

A number of months later, I have left my full-time job (as a SQL
Server DBA) to work full time on the projects that I've been on for
the past year. I write in both PHP and Rails, but I like Rails a
whole lot more. I still like PHP, but I'd much rather write in
Rails. In fact, my "boss" is so happy with the work I've done in
Rails that we are going to rewrite the PHP applications in Rails some
time next year. And he's also very happy with my PHP work, so that's
saying something.

One of the sayings of the Rails project is "making developers
happy" (or something like that). I'm married with 3 kids and my
family will testify that I'm happier when I'm working Rails. And I'm
more productive. If I've got a spare 15 minutes, I can get something
real done in Rails. I need about 30 minutes to do the same things in
PHP.

This is just a quick account of my personal experience. I've decided
that all of my own personal projects will be Rails, because it suits
me better. Not everyone will agree. And when I say "personal
projects", I don't mean things that only I use. I have ideas for
commercial-ish applications that I plan on writing and releasing,
with the intent of providing the bulk of my income from them. So,
basically, I've put my personal financial future on Rails back. Only
time will tell if that was a good decision.

Oh, to provide something that is directed toward your question, I
have not yet come across anything that I can't do in Rails that I
could in PHP. I may accomplish a task in a different way, but it
still gets accomplished.

Peace, Phillip

... I decided that I wanted some sort of framework
for developing my own applications, so I started researching. I
don't know why, but I didn't come across any of the PHP-based
frameworks.

Really? I found a lot out there. Just using "PHP web framework" in Google gives you several of the leading contenders.

All I found that were serious contenders *for me* were
TurboGears (Python), Django (Python), and Rails (Ruby). So the first
thing I had to do was decide if I wanted to code in Ruby or Python,
and since I didn't know either, it was a pretty fair comparison.

I actually started learning Python and then switched to Ruby (but that was long before Django came out of stealth). I like Rails but I use PHP in my regular day-job.

It's no comparison. Django is crap.

No join models. No javascript integration now or ever. Very poorly documented (http://www.djangobook.com/en/beta/ <- the creat0rz "paused" this year to go write the dead tree version) Views are called "templates" Controller actions are called "views" Template inheritance is upside down (inside out if that makes more sense) They have no clue about DRY (for example, model validation do not carry over into form builders) Models have to belong to "apps" (major problems exist when using models across "apps") No testing framework. Free admin site but you'll lose much hair trying to shape it into something you'd actually use or give a client to use.

I could go on if I thought about it and had more time.

Python: Excellent. Django: Run like hell.

I agree, I haven't found a show stopper yet.

First of all, popularity is not necessarily all its cracked up to be, but you can compare languages here http://www.tiobe.com/tpci.htm

Second, RoR is definitely not every dev's dream, because different projects, people, and organizations have different requirements. I know a lot of people who consider themselves web devs but are not programmers and RoR is too low level.

Third, I've found that the "really cool" Rails developers prefer to bash it rather than hype it :slight_smile: (after all, how else do you motivate to improve it?)

linoj

From what I've seen, and that might not be much, but it depends on
what type of environment you want to work in. If you're looking to go
into enterprise, Rails hasn't made a big splash there yet. You'll
want to know Java and possibly .NET to get into enterprise. If you
want to get into a small web development shop, Rails, PHP, .NET,
about anything you can learn will increase your marketability. The
more you know, the more opportunities you will have. If you are
looking for possible avenues to journey down at some point, don't
limit yourself by learning just one development platform/language.
On other hand, don't spread yourself so thin that you have no depth
in anything either. I talked to a guy once who described himself as
one of the Great Lakes as far as breadth of knowledge, but only about
an inch deep. That's no good.

Peace, Phillip