

Ask HN: PHP or Ruby on Rails - devme

Hello,<p>I want to know, with which language is easy to develop a web project ?<p>Best Regards,
======
nimmen
[http://www.tiobe.com/index.php/content/paperinfo/tpci/index....](http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html)
i would mostly agree with this chart. ruby is on the roll, but i do not think
it will catch up with php any time soon. php has many great frameworks like:

<http://kohanaframework.org/>

<http://www.yiiframework.com/>

<http://symfony-reloaded.org/>

<http://fatfree.sourceforge.net/>

and language is evolving in decent steps, has A LOT components, extensions,
libraries. its easy to find solutions for your problems in search engines, or
community. i like ruby too, but sorry, i will be going probably for
python/golang/(maybe even java) soon (i dont like front end stuff). ruby is
just too young to become something more serious in web development, and other
languages are catching good ideas from ruby fast... you should define your
goals more precisely and choose where you will go next

~~~
pdx
Wow, I just spent an hour reading the fatfree documentation, after skimming
the docs and rejecting the first three you mentioned. I really want to try
fatfree now. Thanks for posting those links.

Damn debian! Time to compile PHP from source, so I can get the rev 5.3 that
fatfree needs.

------
grandalf
The common story is that PHP is easier for a very basic app but that rails is
easier for anything beyond that.

My opinion: Why choose? Try both, write a simple app in both and follow a
tutorial or two. Decide which one you like best. Which was easiest to find
documentation? Which community was more helpful to you?

I'd also recommend checking out Sinatra, since it's sort of in between the two
other frameworks you mention. It does more than PHP and less than Rails, but
is (I think) far simpler than either one.

~~~
wmwong
I agree. I think you have to try both in order to know whether you made the
right decision. I started off learning PHP in the beginning, then switched to
Ruby on Rails. Of the languages I've learnt so far, Ruby is by far the most
fluid. It's a beautiful language. Rails allows you to do many things really
quickly as well, and at the time that I switched, PHP was still lagging behind
in frameworks. I haven't hopped back into PHP, so I'm not sure where they are
now, but I haven't looked back since going onto Rails.

------
DCoder
PHP hosting is easier to find. Competent and secure PHP hosting is hard to
find. Most PHP hosts run with all the compatibility options on to support
their existing customers who were too cheap to get their sites done right. PHP
is easier to start with, but more complex to grow in the right direction. PHP
is ridiculously inconsistent and frustrating ([1]). If you get stuck, PHP
coding help is easier to find... but it's useless 95% of the time as people
give the same old wrong answers. Lower barrier to entry - more clueless
"coders" on the forums sharing their (lack of) knowledge. Following from last
point, "coders" like that mean you can get more consulting gigs fixing their
crap.

Personally, I stick to PHP for new projects because it's what I know - trying
RoR out would have to be a spare-time endeavor, and I already have tons of
stuff I like to do in my spare time. If I had no prior experience, I'd
probably pick RoR though.

[1] ignoring the old tired rant about function naming: object->badproperty
just causes a notice and carries on, object->badfunction() crashes with a
fatal error, null->property, null[property] and 1 + undefined are also just
notices... basically you want an error handler that turns _anything_ into a
fatal error, but then you can't co-op with any older code as even older
"frameworks" such as Joomla are full of that crap.

------
SingAlong
Try both (Ruby,PHP). Find out about frameworks in php (cakephp, codeigniter)
and in ruby (sinatra, rails, etc) And not just read the docs and say "i dont
want this thing". Try this: develop a user login and signup system in both.
see which one is easier.

Quick facts: 1.) It's easier to find php hosting for cheap. low cost to get
started.

2.) It's easier to develop a prototype in Rails quickly, especially if your
app has some CRUD stuff, you can get it up and running in no time, but this
interface would just be for testing. Its called scaffolding.

3.) You can do the same scaffolding in php frameworks like cakephp.

4.) With ruby you get a lot of well-built libraries which are called "gems".
they are handy and are centralized, so you can update to a new version easily.

5.) With php you can get a lot of cheap man power to work on you app if it
requires some complex plugins.

6.) If you are going to use ruby, I suggest getting familiar with linux
commands. That way you can find cheap vps to host the app (but not as cheap as
the php hosts you'll find). Or develop it on heroku's free plan.

7.) Now that you know these, go develop the app on whichever language you find
easy.

P.S: If you are seriously out of money, and can spend only in single digits
($x), you should seriously consider doing the app in php. The same applies if
the app is too simple

------
cmykgrayscale
I would suggest Ruby. I found php easier to learn, but it was so easy to write
bad code in it. Ruby on the other hand forces you to follow solid design
patterns.

Also on a side note, ROR is a framework for Ruby, so you cant compare it with
PHP. There are some really good PHP frameworks out there too (Symfony,
CakePHP, Codeigniter) but they essentially try to imitate ROR and bring those
design paradigms to php.

------
kunjaan
This is an interesting question. Are there any credible web resources that
compare and contrast the web development framework? I think there are main
variables involved are :

1\. Accessibility to good developers

2\. Hosting options

3\. Scalability

4\. Tools Support for Building and Testing

5\. Documentation and Developer Community

6\. Security

7\. (something i missed?)

Could some one help the guy by comparing the two according to these factors or
point to some credible study?

------
keytweetlouie
Keep in mind it will be easier to hire PHP dev's than ruby developers. If you
find a good ruby dev you will have to pay $$$$.

~~~
stephenjudkins
Why do you think that is? I would suspect it's not because people are locked
into huge legacy Ruby codebases.

If Ruby devs are paid more, it's probably because they're more productive.
Now, I'm not a Ruby fanboy, and people can be very productive in many other
languages. I think in general paying someone far less to write a codebase in
PHP may be penny-wise but pound-foolish.

PHP is, in my opinion and that of many others, a very poor language that
encourages poor coding practices. It's possible to write good code in PHP and
poor code using Django/Rails but I think there's a strong correlation between
the tools used and results produced.

~~~
keytweetlouie
PHP vs ruby is not like going from java to ruby. You may see productivity
gains. However, PHP is so well established you may even save time by taking
advantage of all the open source code written. PHP has done wonders for the
devs at facebook and digg. I feel the need for "nerd cred" is too high these
days. Using older tech that has a proven track record is still a good idea.
Your start-up may not be the cool kid on the block but once you're making
money nobody cares. I do use python and django myself and LOVE IT! Can add
that to your list?

------
Mark_B
If you're only starting out, I would be less concerned about the technical
pros/cons and figure out which ever is easier for YOU to pick up.

Check into whatever your nicest techy friends are using.

After all, if you run into any problems, they'll be ones you'll reach out to
for help.

------
devme
Thank you for all you comments / suggestion . Thanks again

