

Ask HN: PHP or RoR? - hansy

I'm a brand new web programmer trying to create my own social networking site and I've been learning PHP and the Drupal CMS these past few days to build my website.<p>I ran into a developer the other day and he suggested I work with RoR instead.<p>As I have minimal starting experience with C++, the OOP side of PHP is what drew me (and the fact Facebook also uses it) in the first place.<p>Now I understand different project needs translates to different languages, but I was just curious what the HN community thinks about the two?
======
jjunkin
RoR is clearly a better language than php from a prgramming standpoint. _BUT_
PHP is perhaps the best supported language on the web. By support I mean
platform choices, documentation, discussion, number of programmers, libraries
and plugins and stability.

Even though it's the ugly child, you won't go wrong with PHP. It scales, look
at facebook. It's where the jobs are.

I hope one day ruby overtakes it, but until then I would vote for PHP.

~~~
itsrobert
_RoR is clearly a better language_

I'm not sure if you made a mistake here, but RoR is a framework. Ruby is a
language. RoR shouldn't be compared to PHP. If anything, it should be compared
to one of the many PHP frameworks out there.

I agree that there are a great deal of jobs for PHP, but I disagree that "It's
where the jobs are." There are a great deal of jobs around for RoR.

~~~
jjunkin
Hey, I just replied to what the poster submitted. Sure rails is a platform and
ruby is the languge. My arguement still holds, PHP has far more support and
ruby is a better language. Same goes for platforms, PHP has far more options
and ruby has few. IMO PHP wins because it has more resources. But as a languge
i like ruby better. As for jobs, I didn't say there were none for rails/ruby,
just that there are far more for php.

~~~
itsrobert
I wasn't disagreeing with your argument. I mainly just wanted to clarify a few
things for the OP.

------
autalpha
I did PHP and liked CakePHP when I started out. After I did that I looked into
both Ruby/RoR and Python/Django. I ended up liking Django much more than RoR.
I do a lot of Javascript at one point and the intriguing thing is, somehow
Python felt more natural to me. I DID try Ruby and looked at Rails though. I
would recommend just testing things out yourself and see what comes more
naturally to you.

One can do a lot of goods with PHP, Ruby and Python and any other
languages/frameworks. It's not really the language but what you choose to do
with it as well as your experience using it that will make your project. The
only way to gain more experience is to start using it.

My feeling is, you want to pick something that will solve all your present
problems and future proof. That's going to be difficult. Big solutions are
usually a combination of different efforts because there are many different
parts of the web development process. I've seen a company that use PHP for ALL
their flow including the cron jobs' scripts. Some might say, that's crazy, why
not use python or faster languages for backend jobs? But it worked for them up
until they hit their bottleneck then they reiterate and revised.

The path toward the "holy grail" for the perfect "solution" is long. Crowd
sourcing for this answer will also be difficult because many people have
already took that journey and fought their holy war with themselves so they
will generally give you their preferences up front.

Sorry for the round about way of saying: I think if you are at a point of
asking question of what's out there other than PHP? Then you're at a good
transitional stage. Congrats. Now your two (popular) choices are: Ruby/RoR and
Python/Django. Go test out two sample projects and make it work from setting
up to making it run. See which process you like the most and pick one. I don't
think you will go wrong with either choices.

Oh, is there a site that you really like or look up to? Perhaps you can learn
about their technology stack and give that a try :P

Again, sorry for the convoluted answer and good luck with your journey toward
Web Dev nirvana :)

------
gdulli
"Now I understand different project needs translates to different languages"

This is much less true than you'd think when you're talking about languages of
the same class, like Ruby and PHP. (Sorry, Ruby; I didn't mean it that way.)
And when your goals are vague ("social networking site.")

The ease of setting up PHP will retard your progress towards understanding the
web stack in greater depth, Which is something you'll need to do if you want
to become a good web developer. Setting up Python or Ruby with Apache isn't as
difficult as you would think it is, given how often the ease of setting up PHP
is cited as a reason to use it.

You'll learn better habits and practices from the Ruby or Python communities
than the PHP community.

------
eswat
Build a prototype with a few features in both and see which feels natural to
you. I like to bang out small, silly projects in PHP with CodeIgniter or FUEL
because I can move fast with those. But I find Ruby and RoR more
methodological and RoR will handle more intricate stuff for me that the PHP
frameworks won’t and will use that combo for bigger apps.

------
trbecker
Proposing to you a third option: django+pinax. Pinax is a ready to use social
networking application using django. Take a look: <http://pinaxproject.com/>.

------
nametoremember
Try both out and see what you think. Some big sites use PHP like Facebook and
Flickr. Here are some sites that use Ruby on Rails:
<http://rubyonrails.org/applications>. That list lists Twitter but I thought
they changed so I am not sure how up to date it is.

I personally like Ruby and I like Rails. To me Ruby looks cleaner than PHP and
as a result, it gets less messy with lots of code.

Rails is the framework. I love the MVC concept even just for separating my
files logically.

------
pdenya
I recommend PHP for what it's worth. Ruby is great but PHP is fast, easy to
deploy and common enough that you never need to look far for an answer to your
problem or a module to help you out. Rails has gems which are amazing but
there are far more PHP programmers.

If you're looking for a framework for PHP I'd recommend CakePHP assuming
you're not rolling your own for this.

~~~
nametoremember
It is ruby that has the gems - and they are great. You're right on the speed
but language speed is rarely a bottleneck for a website.

CakePHP was modeled and inspired by Rails.

~~~
pdenya
Thanks for the clarification. I phrased it that way because OP really is
comparing Rails to PHP (ie: he won't pick Ruby w/out Rails over PHP).

CakePHP is an MVC framework similar to Rails but they're pretty different now
(details wise, structurally still similar). I prefer Rails to CakePHP in most
respects but I still code with cake because I like PHP.

