Why Isn't Ruby More Popular than PHP?

Does anyone have a simple answer? I’m only just beginning to learn Ruby after being a PHP developer for about 4 years, and it seems clear that Ruby is the better language by some margin (not necessarily a better platform; I don’t have enough experience to draw that conclusion). Ruby just makes so much more sense than PHP. The syntax just seems so well polished. In fact, it’s probably the nicest language I’m yet to see (and I’ve spent time with at least 8 different modern programming languages). So far there’s not a single bit of syntax or idiom that I’m not happy with.

Why isn’t the take up as aggressive as it probably should be?

I would say it’s down to the user-base. So many scripts and apps exist for the platform it’s become heavily ubiquitous (both in host adoption and standardisation).

Also, there is a far larger existing user-base for PHP, which means it’s easier to find support for the language and people obviously get attracted to that aspect. :slight_smile:

PS: I like Ruby too, though not nearly as much as Python :wink:

ruby came into popularity with the advent of Rails framework, which came into existence just 4-5 years ago. But ruby on rails is expanding really fast in the web development scenario today and it is expected to become the top 3 languages in the next few years.

I would say it’s 2 things. First, its younger and does not have the user support of PHP. Second, many servers don’t come with Ruby preinstalled. Just like people use IE because it is there, many developers stick with PHP because it is just there.

Popularity has nothing much to do with how good or bad something is. It has far more to do with how well each is marketed. Often just because something is popular means that it gets well marketed by those using it so that it remains popular.

PHP is just old stuff. Like many people use FORTRAN now.

There are thousands of PHP hosting sites out there. It’s a lot easier to deploy them. You don’t have to have custom configurations. I think the big reason is it’s just easier.

I think a major problem with Ruby not being as popular as it should be is its poor support for Windows. This is not a good thing for a language that’s supposed to be cross-platform.

You have to jump through all sorts of hoops to get it installed and even then not all Ruby scripts are compatible with Windows. For instance if you do a simple call in a command line program to clear the screen System(“clear”) it won’t work for Windows which requires System(“cls”). You have to look at the OS version and send the appropriate call.

There are other little gotachas like that all through out the system. Like some ruby gems require compilation and they are not written for Windows. Most Ruby programmer seem to be Unix/OS X people (I am) so they don’t bother making their stuff work with an operating system they loath.

I know I don’t write in Windows support because I’m sick of having to support substandard systems like IE. I have to spend so much time at work fixing Microsoft’s buggy browser I’m not spending 80% of my time in Ruby writing fixes for Windows when I can have the app up and running in a fraction of the time.

Hence Windows based programmers look at Ruby as a “Mac elitist thing [they] don’t want to waste time on.” (An actual quote from a work buddy). And refuse to even look at it. I can’t tell you how many Windows programmers I’ve spoken to over the 'net or at work that say they hate it and list all these reasons that don’t even make sense. When I ask them if they have every used it the reply is usually either “I tried to install it and it was too much of a pain,” “I tried it for a day but nothing worked right.”, or just plain “No.”

I personally think it’s silly to hate an OS or computer or language but then again I’ve never been the fanboi type. I want to use what I like best and what does the job best for me. Right now that’s Apples and OS X.

I think another thing that is slowing the adoption rate is the file setup. Yes, Rails is the ‘leader’ when it comes to ruby on the web, but with php (never bothered learning it because the syntax is ugly) you can upload a single file and you’re good to go.

With rails getting something running is a little more complex.

I have been out of the programming loop for a while. PHP and Perl is where I left off and it works for me so far. But with all of the RoR talk, - is it something I should look into and why?

I don’t agree with you, Luis Lavena and some guys made a huge work on the Ruby installer for Windows and Devkit allows you to compile native gems. Of course, it’s not perfect but they usually help you quickly on the mailinglist when something goes wrong

You can disagree all you want but that doesn’t change the facts. In fact I just tried installing Ruby in my Windows boot camp partition and it was a huge pain.

What was the showstopper?

Why Isn’t Ruby More Popular than PHP?

To me, the main reasons are quite simple:
no affordable shared hosting like php
no major open source apps like Drupal/Wordpress/phpBB that could bring people to learn/use Ruby

Why do you want to switch to Ruby? As I know PHP is faster, not faster do develop but faster to render! or what do you think?

Wikipedia says Ruby interpreter is one of the slowest.

I did some work with PHP 3, back at the turn of the century. Basically, it showed up at the right time with the right set of trade-offs. On one hand, it was a mess. On the other hand, it had an incredibly low barrier of entry. All people needed were the same text editor and FTP client they were already using to create and upload websites with animated GIFs to GeoCities.

Ruby is an entirely different beast. It was created as a Perl derivative with a solid object oriented core inspired by Smalltalk. Since it had very little documentation, most of it in Japanese, it only caught on when the Pragmatic Programmers wrote a very good book about it, which became the de facto language and standard library documentation.

Wordpress, Joomla, Drupal, Moodle, PHPBB, plus it’s ubiquitous and runs on a £5 per month server.

To a developer Ruby is nicer but to the majority of people who don’t want to, or care about code, PHP fits the bill.

<snip/> You’re actually complaining that a windows command prompt has different syntax for “clear screen”? I’ve never had an issue with Ruby or Rails on windows (not one). It’s more popular on Macs mainly because long ago Apple started including it with their OS builds. Installation on windows is simply:

  1. Run Ruby setup.exe
  2. Run Gems setup.rb
  3. In a command prompt, type “gem install rails -v x.x.x”
    (that’s it, except right after that I’d do “gem install mongrel” as mongrel is a much better server to use for local development)

The #1 thing about Rails is you can program any site faster than with any other language/framework. And, once that site is built you can maintain it much easier. Programmer time is the biggest cost in application development and deployment (two servers are cheaper than two programmers, etc.).

Rails development houses like Hashrocket (http://www.hashrocket.com/) have a chance at really flipping Rails and PHP usage figures. They easily have (or can have) a delivery speed and pricing advantage.

It’s rare that someone learns Rails and then goes back to PHP.

My old standard language vs laguage answer: “The BEST language is the one you’re getting paid to use.” :slight_smile:

actually I think Ruby is pretty popular atm,

I have been a PHP developer for years now,
what I’d like to know is what are Ruby advantages / disadvantages compared to php ?

Ruby is nicer in so many ways, most of which you don’t fully appreciate until you’ve used them.

Syntactically it’s lovely, statements such as date.today + 1.month just rock. It has excellent support for blocks (anonymous functions) and you use them all the time eg.

people.each { |person| puts person.name }

would iterate over an array of people writing out their names.

Everything is an object, including classes and methods. Even numbers are objects and can be extended, hence 1.week. Operators are all methods so you can for example define the = method on any object you create.

You also get access to Rails which is a super super rapid application development framework. You can tackle impossibly big projects in weeks rather than months without any of the limitations that a RAD normally imposes. I like it. I use it for any large project.