Content Management System (CMS) News, Reviews, Events and Analysis.
 
 
 

PHP vs Java vs Ruby

With Sun GPLv2'ing its Java software this week, a lot of focus is on the other open frameworks that have risen during the same era, and their comparative value in a post open source Java world. One such take is from well-known Sun insider, Tim Bray, who spoke at last week's International PHP Conference in Germany.

Bray, who is Director of Web Technologies at Sun Microsystems, co-creator of the XML 1.0 and XML Namespace standards, co-founder of Open-Text, and contributor to the Atom Publishing standard (whew!) spoke in a presentation entitled “How to combine PHP technology with Java based on Enterprise Systems” (download PDF).

In the slide below, Bray outlines the basic advantages of each of these three platforms (or rather the two languages and one framework if you are scoring at home). In perhaps in a nod to his new employer, Sun, Bray totally omits any mention of .NET or smaller products like Adobe's Flex/ColdFusion platform.

His idea, if you are able to take it on the surface only, is to rate your priorities of: 1) Scalability, 2) Dev Speed, 3) Dev Tools, and 4) Maintainability. In this highly generalized approach, you could theoretically pick your web application building language/framework based on only these priorities.

Tim weighs-in heavy on the maintainability side, and we'd tend to agree with him. To quote:

“Good apps, once built, tend to be in production for an astonishingly long time. Which means that they have to be maintained for an astonishingly long time. Which means that maintainability is important. There are a lot of things that go into maintainability, but I suggest that the biggies are object-orientation, MVC architecture, code readability, and code size.”

On the maintainability side Tim places Ruby on Rails out front. Quoting him again, Tim describes why RoR is in the lead here.

“Mostly because there's less code. The fact that Ruby forces MVC on you helps too, also the fact that the templating and [Object Relational Mapping (ORM)] and testing and application code are all so tightly integrated helps. Bear in mind that we still don't know how well Rails is going to work outside of the CRUD-centered greenfield app space where it shines.”

Tim's metrics don't really exist on a quantitative level nor are they based on any published statistics — just a very informed intellect and a privileged position. Obviously, additional parameters such as total cost of ownership and native security (PHP, we are looking at you) should also play a big role the decision making process.

As you can probably guess, in response to this presentation, the proponents of Java, PHP and Ruby are lighting the Internet aflame in defense of their platform of choice and at the same time nay-saying their fellow players. While very entertaining and sometimes educational to follow, not much is going to be gained from this bickering.

Bray concludes the presentation with the Rodney King-esque statement “One way or another we all have to integrate.”

The reality is that there are a great number of ways to hone-in on the language or framework choice for a web application. Many factors have to be considered and weighed against each other. The beauty of what we have today is that there ARE a great many choices out there, much more-so than even a few years ago.

The fact that open source options are being stacked up against the likes of Java and .NET, and have a similar levels of support is a blessing. Today, with the open-sourcing of Java, we have a new entry onto the field. Rather than exclude one or another, this arrival is going to make the open source web world, warmer, more sophisticated, and for better or worse, a little sunnier.

 
Read More About:
, , , , , , ,
 
Was this article useful?
 

80 Reader Comments

1 | Pawel — January 30, 2007 4:50 AM

Scaling for PHP projects is better
then for Java project??!!
ROTFL !

2 | MATHEW — January 31, 2007 9:47 AM
3 | Jon — February 1, 2007 8:04 PM

Use Perl. It is the best of the lot.

4 | John — February 1, 2007 8:18 PM

Nice read. You make it much easier to understand the differences. I have dabbled in all three but could no way articulate the way you have. Thanks.

John
http://www.monomachines.com

5 | Motorcycle Guy — February 1, 2007 10:46 PM

Eh Jon, I dunno about perl being the best over all, personally I think database support in perl is lagging behind all three of these, however text file support and implementation might be superior.

6 | Nahum Wild — February 2, 2007 1:31 AM

A good example of a non CRUD app developed with Ruby on Rails is www.zoomin.co.nz, an online mapping site. It seems to work well and has recently be adopted by TradeMe (also .co.nz) for their mapping.

7 | albel — February 2, 2007 1:57 AM

PHP is more scalable than Java? I think this guy is joking!

8 | Anonymous — February 2, 2007 2:44 AM

Uhhhhhhhhhhhhh

You're comparing two languages to a framework in another…..

How about struts vs cakephp vs rails?

anyhow, ridiculous comparison.

9 | Mark — February 2, 2007 3:40 AM

How about availability?

All hosting companies can probably deliver a low cost PHP server environment (shared), however, not many have Java or RoR.

10 | Hasan — February 2, 2007 3:41 AM

ASP.Net is the fastest in development man! + tools(Express)

11 | Douglas F Shearer — February 2, 2007 4:45 AM

“Bear in mind that we still don’t know how well Rails is going to work outside of the CRUD-centered greenfield app space where it shines.”

A project I have just finished work on involved a very complex legacy database schema running on SQL Server. Rails includes many small tools that allow you deal with an old, non-ideal database, and where you have to deal with many foreign keys out-with the standard model structure, you can revert to using good old SQL.

The MVC allows you to demote such nasty bits to the models, leaving your controllers and views totally unaware of the database structure they are working on, allow work to be carried out in the normal way.

I have to say I was impressed by Rail's ability to cope in situation, as having come from a mostly Java background (Some PHP too) I previously thought that any framework would have difficulty without it's own database schema paradigm. Kudos to DHH and the other Rails developers, they truly have built something that can be used everywhere.

12 | Jyot — February 2, 2007 10:25 AM

I had my site(mysafebox.com) originally done in ror and decided to port it to java and it was one of the best thing that I did. It took a bit more time to develop it but the end result was worth it.
The only issue with Java is the hosting which is not as cheap as php ror etc but once you get a good one, you are all set.
Php more scalable than java?? that's a news to me !! Also, Rails is a fw and not a language, please get your comparison right.

13 | Tjerk — February 2, 2007 11:21 AM

He forgets a few very important aspects important for very large scale applications:

- Java scales MUCH MUCH better than all those other languages… just google it
- Java has static typing that is a big advantage for large projects because it results in Contract-Programming. The compiler can check for much more human-errors. Sure it takes more time to develop java code in comparison to php and ruby… but on the longer run java wil prefail because your applicaiton is rock solid due to static typing and programming by contact.

Therefore i vote for separe charts like this for projects that are small ( php will win ), larger ( ruby will win ), or extreme large and compelx ( java will win ).

There or just too many parameters, a vew simple charts like this is not at all sufficient.

14 | utw — February 2, 2007 11:33 AM

Another crucial element to consider is availablility of talent. While Rails is easier to maintain, the real trick is finding someone who can do the work.

15 | Steve — February 2, 2007 12:58 PM

I don’t think one language is better than another.
I used to be a Java programmer for 8 years, but am getting tired of it. Java tries to solve too many issues, and it is getting too much complex.
PHP is very simple and easier language, and also have lots of Open Source Project out there when it’s needed. Ruby has nice framework.
I can’t choose one, but I will probably choose ROR for most of the project.

16 | The Average White Guy — February 2, 2007 4:14 PM

Not only is ASP.NET faster, it's also easier to administer than Java or PHP, and I've done them all.

I still use PHP where cheap and easy is the goal, and I'll never knock how strong it is as a web-app platform, but if I had the run of the lot, and no budget, I'd do ASP.NET every stinkin' time without a second thought.

I was born and raised (in college) to hate MS, and everything Windows, including VC++, VB, VJ++, etc… but when C# and the .NET framework made it's debut, I was hooked. Long live MASTERPAGES!

17 | Oscar — February 2, 2007 9:02 PM

Some one is bringing up .NET. Where was that mentioned? Am I missing something? Who is .NET. Move on. Average dude.

18 | nhm tanveer hossain khan (hasan) — February 3, 2007 5:31 AM

Not impressive,
how this comparison was calculated and based on which type of project?
these 3 platforms have different advantages and usages. why we need comparison. rather we want to know the right usages on right project.

if you want to host a small site, why will you prefer java? go for php or ruby on rails.

similarly you need a lot of optimization and many Enterprise Architecture integration, so why will you go for php or RoR?

i think comparing between RoR and PHP is fine enough, java is better for comparing with lot of other features.

Obviously java should be compared with .NET, because this is growing as one of the alternative of Real Java stuffs.

thank you for your post.

19 | flash devs — February 4, 2007 4:16 PM

PHP has more tools than Rails, come on.

20 | Bob Dobbs — February 4, 2007 5:44 PM

ASP.NET is not Open Source, and it's only an option on windows… which not everyone uses, despite your limited point of view. It's not even considered. Fools.

21 | Franck — February 6, 2007 3:41 PM

I think that comparing 3 languages/framework is already difficult, but become ridiculous in such a short space. Each has its own benefits / drawbacks, it should have been better give the best tool for project typologies… but then you would have to compare PHP frameworks with Rails ;o)

22 | Alex — February 12, 2007 12:51 AM

How many exampes/scripts are there for PHP?
How many are for Rails?

23 | Jason Michael — February 12, 2007 10:39 PM

This article is just out there to stir the soup. The author knew it would do something. Heck, someone could write this article in a few weeks or a month, and it would get attention like bees to honey. the beauty of it, is that its attracting developers for all of these languages, to come here and read it… its not really giving us anything we didn't already know… Whoopee Doo.. Bray speaks, and pretty much tells us nothing…. No matter what our opinion is, or whatever his is… nothing is going to change…. absolutely nothing…

24 | David Zonsheine — February 16, 2007 5:26 PM

Anyone knows what languages are used by the big web2.0 sites today or at least a few examples?

25 | Eylon — February 22, 2007 8:29 PM

Nice article.
I agree to every word.

26 | UnicMan — February 28, 2007 8:57 AM

If we want to compare the frameworks precisely then I believe it should be using CakePHP, RoR and Spring MVC.

27 | add — March 21, 2007 6:42 AM

how do you measure these things? it's subjective.

28 | vnjug — April 23, 2007 4:19 PM

I use Java and PHP at the same time after moving away from ASP.NET. ASP.NET is slow, use much memory and hard to be as scalable as Java and PHP.

29 | sammy — June 21, 2007 5:34 AM

I have experience in all 3 areas.

My rating is PHP > Java > .NET

Why? see below:

1) PHP is easy to learn, fast to deploy, highly scalable
and extensible. We also can do load balancing with
PHP like Java. Further we can develop enterprise class
applications with good security etc.all. We have
cakePHP and Symphony web frameworks that are
really good. Smarty is good templating engine. But,
the downside is we can't do certain things in PHP like
knowing how many bytes of a file are transferred to a
server when uploading a file.

2) Java is good at everything but the problem is a
typical J2EE developer needs to read 1000's of pages
about various web frames works, template engines to
make choice and do perfect deployment. Few people
have that patience. Also, we need more investment to
buy superior hardware (Good RAM etc) that is a must
for J2EE applications to run faster. I learned hard to
find that JSF + velocity is a good choice. May be u
disagree and think Java + Flash is a best choice.

3) Microsoft .NET is excellent but then again issues of
hardware like Java for speed and OS specificity.

New features to a language and new frameworks come with time. I believe PHP, an unarguably easiest language to learn, will also get all the just mentioned desideratum with time. So, I think I will always be with PHP.

I love PHP. :-)
Jesus loves PHP. :-)
So, you all should love PHP. :-)

30 | hmm whatever — August 10, 2007 1:49 PM

You can't really compare scalability with rails and pure php/java.

It's ridiculous. rails is a framework, it goes through many computations and object related mapping, of course it will be lower than the pure languages. If they checked out pure ruby (the programming language not the rails framework) I'm sure the results would be different. Script running for ruby has been proven to be faster than php on most occasions.

Why are they comparing a framework to languages anyway? They can compare frameworks to frameworks. Php has symfony (and I hear some kind of zend framework will come out soon), and java has tons.

I'm a little confused here, do they even know the difference between ruby and rails?

31 | me — August 25, 2007 4:34 PM

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=php&lang2=ruby

Ruby is faster than php? Where's your evidence. Look at this URL. The ONLY thing ruby beats php at is startup time, which in afast-cgi or mod_apache setting is meaningless. Yes php consumes more memory, but that's because of all the builtins. There are a myriad of ways to mitigate that: custom compile php with only the extensions you really need, use an opcode cache (more speed too). By the time you throw rails on top of ruby, it will be even slower and more memory consuming. So if we're going to compare php to rails as the RoR camps likes to do, they fail…

32 | Ghanshyam — August 30, 2007 3:35 AM

There is no need to compare, because each one has their own advantages and disadvantages.

In terms of speed, I would say:
PHP < .NET < JAVA

But in terms of maintainability:
JAVA < .NET < PHP

So, they have pro both cons.

33 | my2cents — September 1, 2007 9:14 AM

different people are saying language 1 is faster than language 2 or language3. How can we trust that this is the case in reality? this is just based on their own level of experience with each particular language. i.e they may be stronger in one language than the other, and so produces better code in that language and less efficient language in another language.

why don't we bring a so called expert in each language and give them the same requirements and get them to produce the code to meet the requirements and then run their programs and see which is faster or more maintainable ?

mind you there is still a problem if a so called expert in one language may not necessarily be at the same level of expertise of another expert representing another language.

in which case, we can replace the experts with 3 people who claimed that they have worked on all 3 languages and get them to write their code in all 3 languages and then compare the performance of the code generated by all 3 people for all 3 languages i.e altogether there should be 9 programs produced (3 x 3) and compare them. that would allow us to be able to see what their level of expertise is and also the performance of the code they produced, and maybe the performance of the languages

34 | OutThere — October 1, 2007 6:20 AM

flash devs: PHP has more tools than Ruby?

More people drive a hyundai than a Maybach.
Does that make Hyundai a better car?

Come on!

35 | Vishwajeet — October 10, 2007 4:14 AM

Ruby's dynamic typing means you don't repeat yourself: How often in Java have you had to suffer through verbose code along the lines of XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence();? Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be xmlPersistence = persistence_manager.persistence.
Ruby's dynamic typing does not mean weak typing—Ruby always requires you to pass objects of the correct type. Java, in fact, enforces types more weakly than Ruby. For example, Java evaluates “4” + 2 as “42”, coercing the integer to a string, while Ruby throws a TypeError, telling you it “can't convert Fixnum into String.” Likewise, Java, sacrificing correctness for speed, can silently overflow an integer operation, producing weirdness such as Integer.MAX_VALUE + 1, which equals Integer.MIN_VALUE, while Ruby simply expands integers as needed.
Despite Ruby's advantages, Java's static typing does give it one ability that leaves it as the preferred choice for large-scale projects: Java tools understand code at development-time. IDEs can trace dependencies between classes, find usages of methods and classes, auto-complete identifiers, and help you refactor code. Though parallel Ruby tools exist with limited functionality, they lack type information and so cannot perform all these tasks.

36 | Mark — October 16, 2007 7:31 AM

LMAO.

Rails is a framework and it is a layer between the parser language and the programmer and dependence on it is IMHO silly as you are putting your faith into one basket that the developers of the “Rails” you use have taken care of possible hack and security.

Like all language layers they come bug ridden. So your stuck when one exists.

Rails IMHO is pointless , another money making enterprise in the programming market and when people wake up and see exactly why they are bad, they will realise that their entire workforce is dependent on a system that offers no skill diversity nor any real programming skill.

Sure it may speed things up but it comes at a skills cost.

I am old school, learn ground up first, NEVER rely on some layer to do what can be done efficiently in the parser as the parser as the rails needs to be run then the output to the parser for the remainder of the process.

37 | Fred — October 16, 2007 7:24 PM

Asp.net is open source under mono. It's still not 100 % finished since webparts is missing, but that's not a problem for most projects.

http://www.mono-project.com/ASP.NET

38 | Massimo — November 6, 2007 9:42 PM

I am surprised you have no Python framework in the picture since there are more frameworks in python than in any other languages and Python is know to be much faster than Ruby and cleaner than Perl. Anyway, if I may, I would like to suggest Gluon, http://mdp.cti.depaul.edu, since it allows you to byte code compile production applications and I would like to see some benchmarks.

39 | saurabh purnaye — January 16, 2008 2:58 AM

rails is more faster.. pls look for the rails2.0.2 documentations and refer these
http://www.youtube.com/watch?v=n1NVfDlU6yQ
http://www.youtube.com/watch?v=Ld919lziKgE
http://www.youtube.com/watch?v=GQXqWkWqnSw

40 | mrmind — March 13, 2008 5:51 AM

What are the comparison goals?
What are the factors to be studies to achieve these goals?
What are the methodologies to measure these factors?
How the tests had been done? on which platforms, with which version of OS, platforms, frameworks?
What are the sizeS of projects under testing?
We first need to clearly identify the above mentioned issues to give the comparison its credibility!!!

41 | H, The Anonymous — April 2, 2008 9:59 AM

First of all - .NET is not a real choice. Once you use Microsoft product you're stuck with all of their other shitty products, especially 'wannabe' servers like Windows.

Java is parody of a good language. It's incredibly slow (for a compiled language used in virtual machine) even with JIT and Sun's JavaVM for x86 likes to hang. We have a kind of myspace social network in Poland, which used to run on Java (grono.net). Even with Oracle database and a huge cluster network of servers it suffered from major performance issues.

PHP is not faster, but it's more scalable IMHO. Another social network with 11 millions of users works on cluster server with PHP. PHP is not well-written but every release gets closer to be a good enterprise-level web programming language. Besides - there are tons of good soft based on PHP.

Ruby on Rails it's just a framework. And Ruby…nah, it speaks for itself. How many corporate websites runs on it?

The more interesting alternative would be Python, but only if next releases of mod_python for apache 2 allow to easy use of it on vhosts.

As for Perl, it's too complicated to be web programming language of choice for many developers.

42 | Alexander — April 7, 2008 9:55 AM
43 | MaxTheITpro — April 16, 2008 3:12 PM

I'm really feeling PHP lately with all these super frameworks (Code Igniter, Cake, Symphony, Zend Framework, etc.) out there. Now that a lot of web apps will be saying goodbye to PHP4, I expect better things in a hurry — especially with PHP6 on the horizon.
Also, a new generation of web hosting outfits like Media Temple with their grid computing server architecture means that PHP web apps will be even more desirable to programmers and consumers alike.

And yes, Rails is just a framework. It should be compared to CakePHP, Struts, Symfony et al.

Happy Computing!

MaxTheITPRO

44 | pankaj — May 2, 2008 5:01 PM

See, The Whole Point is this it is not just about writing a small code or making a highly OOP code that can be managed well because at the end of the day it is still a web based applications
so inconsistencies are apt to happen be it JAVA PHP ROR or EVEN ASP.net

Lets talk of Performance PHP is 36 times faster than RoR , and much faster than java only because Compiled Cache and stuff is bullshit for web Apps Every time a user access a page if under certain conditions the app has to be compiled on the fly as an interpreted code. Even java has to do it and what java does can be easily done using any php accelerator and cache managers available in php.

Trust me there is nothing out there to beat php in terms of language features and superiority.

And as the language php was built on an incremental basis
It has features to support OOP, Extreme, Ajile Development Methodologies ….

But Still has Good old way of procedures there for you, It dosen't force OOP on you like java or RoR.

Because Not Every One is looking forward to writing an enterprise Web App so PHP serves the purpose for all variety of users although it still has to mature a little further in terms of tools like editor etc and synchronizing software coupled with testing and concurrent version software to be enterprise ready. Other wise the langusge is alredy Very much Enterprise ready.

45 | Anton — June 8, 2008 11:33 PM

Truly I am baffled at some of the responses to this article.

Yes this article does show any sort of evidence as to WHY one language (and framework) is better than the other, apart from a very subjective view. And yes the article also loses plot by saying RoR is a language. However just about every single response went ahead and did this as well.

People are saying some ridiculous shit like “PHP > .NET > Java in Maintainability” or “Java > PHP > .NET in speed”. Where is your goddamn proof? OK, I'll admit its very hard to prove which is better in terms of Maintainability, but there is very little evidence to suggest otherwise for speed.

My two cents is this:

- PHP is a fantastic language for beginners. Why? Where's my evidence? Simple. I started hacking scripts together when I was only 15, and I didn't have to understand Object-Oriented concepts and nor did I have to understand how to use a framework. I just wrote simple iterations, with includes and echo statements. And I bet there are tons of you out there who did the exact same thing, and are probably doing now.

- .NET/Java/RoR are fantastic for well structured code, which in principle helps with maintainability. They are all pure Object-Oriented environments and attempt to lock you into good coding practices. This by no means whats so ever assured good code, but it goes pretty far in attempting to do so. And I don't need evidence to prove this either, just learn the goddamn frameworks and you'll see for yourself!

And finally SPEED.

This is a strongly debatable topic. Some say .NET is faster because it uses Precompiled code, others say that its not true and that it uses advanced levels of caching like PHP Accelerator does (http://www.sitepoint.com/article/php-top-10-net-myths-exposed). Either way, it all comes down to the Big-O notation (http://en.wikipedia.org/wiki/Big_O_notation) and how you write your algorithms and database schema. I am yet to see an application written in very optimized code, in .NET, PHP, Java and RoR and then have a thorough speed test run.

46 | Ponraj — June 20, 2008 10:00 AM

This comparison is not true, in all the casees..

I definetely doubt Rails cant do everything what you can do with Java. Java is somthing Very big and Rails ant PHP is nothing compare to java.

PHP and Rails makes easy things easy and Complex things as impossible

But Java does Complex things possible and easy things bit tough.

There is no Sence in comparing Java with other two.

47 | CaViCcHi — July 2, 2008 1:34 AM

Why do you think that PHP is so low level or just for beginners? :) depends on how you write the code boys… Maintenance comes with your intelligence to project… if you suck in projecting maybe is better if you use something different.

PHP is hard coding, directly derived from C… so has nothing less than other languages. Do you think it's hard to debug? cause maybe you never did it, or if you did… you don't know enough PHP.

Anyway I think that's a stupid comparison between a framework, a precompiled code and a to-compile code

48 | lmcfarlin — July 4, 2008 7:15 PM

I agree with others who think a lot of these comparisons are just dumb. Code-quality has a lot to do with it as does hardware & infrastructure, etc. There are a lot of reasons why an application can be fast, scalable or maintainable. Before any of this can be attributed to a language and/or framework, the lion's share goes to the team implementing the solution. After that, it's the infrastructure and hardware. Only after all of this does the choice between PHP, Java, Ruby or .NET matter and there are a lot of variables in the first two items.

Pointing out some site that couldn't handle the load because it was running such and such framework is ridiculous. Anyone can point out another site that dwarfs the one used as an example.

As an example, ASP.NET has been mentioned here as not being scalable. It wonder how MySpace and Facebook managed to get by with some of the busiest websites in the world running on ASP.NET with almost 200 million users between them. Nonetheless, someone somewhere will write a half-assed application in ASP.NET (or Java or Ruby or PHP) and when things don't work out well the proclamation will be made that x framework sucks.

49 | protospike — July 11, 2008 1:23 PM

It seems like the article is comparing a |framework| (Rails) to two other |languages|. Is that such a good idea?

I use CakePHP which is an MVC framework for PHP. I also know of symfony.

Just because there is more crappy unreadable code written in PHP doesn't mean it's the language at fault. A more reasonable ground for this phenonenom could be explained by the fact that PHP is very easy to set up and get going in, making the language incredibly accessible to all programmers. Of *all* skill levels.

Working with Ruby or Java isn't going to magically make the spaghetti code go away. A poor programmer making poor code in PHP is just going to make the same poor quality code in Java.

Software engineering is an incredibly huge discipline. Programming languages is just but a part of it all. Students start by studying languages, then move onto higher abstractions such as frameworks and studying architectural styles. There's more to it than the language.

50 | FormerDeveloper — July 16, 2008 12:44 AM

I liked the article and thought it useful. I haven't been involved in software development in many years, but if I were entering the career field again for the first time, I have to say, based on what I'm reading all over the web, I'd be getting on board with RoR as fast as I can.

The best thing about the article was raising the question: How should priorities be ranked? What does it matter if one paradigm has better development tools if doesn't scale well? Is maintainability weightier than development speed? Good to get the assumptions out on the table before making the comparisons. Thanks for a good article.

51 | JD-Salinger — August 8, 2008 10:29 AM

hmmmmmmmmm … . . I know RoR, I know PHP, i know ASP.NET, … . the important thing is that you can adapt to any language … and you earn money for that…. hehhehehehe…… and have fun coding to any language you know… There's no such thing as a perfect language…. just like human….

52 | Dinesh — August 13, 2008 2:26 PM

I rarely respond on blogs but this blog tempted me to share my thoughts well.

I have been a developer for few years on PHP and Rails . Now I run my own company RailsFactory where we primarily working on Rails.

Instead of comparing between the language and building enimity between the developer community, I would suggest you guys think in the client point of view.

According to my experience, not much to choose between PHP and Ruby. Either use cakePHP or Rails.

Use Rails : If your client has cool idea and no one is sure whether the application can be succesful in market. You can make the proof of concept available quickly and agile development will keep things rolling

Use PHP: Already have business and the intention is to make an online presence with basic features and also with cheap price.

Use Java: I have not used Java… but people say enterprise applications evolve around it. Then go for it.

53 | sam1 — September 4, 2008 7:05 AM

Perl is my all time favourite and unbeatable in most areas.
Nothing is bigger than CPAN in this world. But recently, I stumbled across python and found that it is a clean language. I always wanted a language as clean as python, speed of C and lot of free modules.

Read on………..

PHP is gr8 but looks ugly. CakePHP is confusing for a lot of people whom I interacted. PHP cannot do many things. Eg: Can anyone tell me how to get the number of bytes transferred to server at a given time when a file is uploaded using PHP code?

Java is gr8 if u can bear with jargon (Hibernate is a big plus) . 'Swing' looses and bows to Wx widgets.

Python forces writing of clean code. Code remains readable even after long time. Python is slower than PHP, Java and Ruby 1.9. but with some difficulty u can make it run at C speed. Further with Perl 6 u can use all the perl modules in python and get best of both worlds.

Love,
Sam

54 | id10t — September 22, 2008 5:07 PM

WOW,

There I've maybe read 3 comments from people who actually know what they are talking about … the rest of you, stay in school.

55 | Will Roe — October 1, 2008 9:57 AM

Speed/performance? Only relevant if you optimize a real application, but then your results aren't relevant to anyone else. Plus the only real differential is the quality of your programming team - anyone can make a dog-slow web app in any language - the real challenge is to write a fast, efficient one (and there's no real advantage to any particular language, only expressive power and flexibility - in which case we'd all be writing in Lisp). The real argument going on under the surface is people's emotional attachment to a language or framework - whether you like it or not (elegance is only part rational, there's a large degree of aesthetics involved).

No matter how much you search, you'll only find anecdotal evidence for one language or another - no real metrics. There just isn't any substitute for good prototyping and R&D. Plus that's the fun bit right?
I find programming in Java fun sometimes, Ruby other times, Lisp all the time ;) In a team you've got to compromise on an agreed language, framework, style etc. Open-source projects are often started by an individual who has the option to choose any language they like, and any programmer can join them - and language becomes part of that decision.

Anyone who's taken a Languages course in university probably has the skills to choose an appropriate language for a problem, but we all get bogged down in our prejudices and favorites.

Have fun everyone!

56 | ashok — October 20, 2008 5:15 AM

i am fond of php, java and .net. but php is best for database and web page development it give forms report, graphs three in one in very simple way

57 | Rob — October 29, 2008 12:40 PM

As a few people and indeed the article above have said this is a benchmark between 2 languages and a language with a framework. It is therefore a completely pointless comparison, you'd have to compare the other two with similar setups to Ruby to get results that make any sense whatsoever, e.g. PHP & Symfony, Java with Spring & Hibernate and RoR

58 | eqbal — January 26, 2009 6:00 AM

I just can't understand how u r comparing java and php with rails , i mean the rails is an MVC framework based on Ruby , I think u meant to compare java, php with ruby instead right , ??? cuz if u wanna use rails , u have to compare it with cakePHP or any other web framework based on php . anyways didn't get the part of that rails not scaling good , how could u find that ? i mean whats the things that makes Rails less scalable ?
thnx in advance

59 | Moby — March 12, 2009 9:08 AM

I found the bar graph a great tool to explain to my client the trade-offs of choosing various technologies to build their initial web infrastructure. My client could care less if it's a framework or a language - they want to know what they'll be stuck with when our team is gone. Yes there's opinions and caveats in the details but from a high level perspective it's great stuff.

60 | Rahul — March 25, 2009 3:50 AM

PHP owns Ruby. So thats no comparison at all.

CakePHP is catching up with Rails. Its only a matter of time now before Cake will get even better because of their hyper-active dev/user community.

61 | Indian — April 7, 2009 3:07 AM

Hi,

PHP is 130% faster than ASP.NET, I like PHP,

Its easy and many free resources r there. compare to other languages.

62 | rakete — April 21, 2009 10:04 AM

You are comparing a scripting language with a Framework and a Programming Language…

This comparison says nothing and it is just stupid…

Sorry.

63 | James — May 6, 2009 12:02 AM

What language would you choose for a Shopping Comparison Website such as www.shopping.com and www.nextag.com ? PHP or JAVA (JSP?) Can anyone give me the advantages and disadvantages for each pertaining to a comparision shopping website? For example, user types in a part number, gets a list of merchants who sell the item. When user clicks on the item, which takes user to the actualy merchant website, the merchant pays the comparison website per click. Merchant can also track its clicks, upload inventory, and add funds to its account.

Any feedback as to the best technology for this would be most appreciated. Thank you!

64 | Greg T — May 6, 2009 4:04 PM

Well, this discussion is already flamed, so i will put it on to :-)
Java: better to large projects with few clients
PHP is better to simpler projects with heavy traffic
Ruby is a “cute” language, but ROR dont scale well, if you dont agree, ask the twitter team.
.Net is the same thing, orkut has been there for years and is not stable yet, even with all the google money, and you cannot be serious to use a windows server in the real world

65 | Ruby-Fanatic — May 14, 2009 8:10 AM

Well,
enough said, but there cannot be an end to better environments, coz development has not stopped.If you look back into history Ruby existed before Java or PHP, but came into limelight later. So giving appropriate time it can beat them.

66 | whatsacoder — June 14, 2009 10:24 AM

Ruby is the most agile - but less used today
php - easy to learn one of the most popular
java - don't know but they say it's scalable

67 | Not-A-Programmer — June 25, 2009 5:00 AM

Well,

I am a client and not a programmer more or less faced with the question what to go for. Should our website and its booking engine (database and ecommerce booking engine for travel products in our case) run PHP or Java?

It would be very good to know which is better with respect to…

performance/speed (visitor experience)
expense (cost of development server/host, future expantion, changes, etc)

and as one person wrote in their comments… “My client could care less if it's a framework or a language - they want to know what they'll be stuck with when our team is gone.”

So, how easy is it to expand the functionality of your website and its system? How cheap is it to run? Which does the visitor serve best? Any succesful business grows and I expect that any website follows suit and develops, which raises the question which is better suited for the future?

Reading this article didn't tell me that much. Reading the comments I only start to guess. Some clearer views would be welcome. And of course any statement should have some scientific reasoning or proof.

68 | kris — June 26, 2009 4:16 PM

So you're comparing PHP + Java, which are languages, to Rails, which is a framework? I can build an app in Ruby that is faster than an app in PHP, it just depends on implementation, requirements, etc.

69 | rocks — June 30, 2009 3:52 AM

i'l go for PHP since this is built from it :D
I like java for its strict implementation of oop and nice orm
php for its the usual spaghetti code
and rails for its simplicity
the truth is, those languages are incomparable..

70 | noschoololdschool — July 8, 2009 6:14 AM

It is hard to claim a language/s or framework/s is superior over another (this is case to case) when someone knows or worked long enough about the language/s he is opposing and/or favoring. Anyone who claims otherwise should have done multiple projects of identical business domain/s deployed on different dev and prod servers even the same physical memories, infrastructures, etc used validated by statistical benchmarks. As developer of server-side programming languages on different platforms including ASP3, PHP4/5, ASP.Net using C#/VB/J#C++, CGI, J2EE, ROR, etc and whatever other languages required by my clients I have to provide unbiased choice of financial/time/resources budgets analysis. It is better to assess the financial gain on using any languages rather think of each languages' strengths and vulnerabilities all of them are trying to improve and hide.

71 | joeComanay — July 8, 2009 1:52 PM

We have used Java, Perl, and PHP at the company I work for. This is one fact that repeats itself on every Java project no matter who the software engineers are:

There is a 10 to 1 productivity HIT with Java over PERL There is also a 10:1 Project size HIT with Java over PERL As far as performance - No difference - except for the java server needing to be rebooted. Java is crap.

Anyone who is NOT religious about languages will come to the same conclusion also. Its not even close.

PHP is a good compromise - PERL is the best.

72 | Tarun Kumar Goel — July 20, 2009 11:30 PM

Plainly comparison becomes quite disheartening without consideration of other important factors, viz, Project size, team size, current skill set, etc. And one alos need to consider the relative importance of scaling, dev.speed & maintainability. These vary widely for different projects, organisations & communities.

73 | therealdeal — August 25, 2009 3:00 AM

I really really like Ruby , it is just beautiful. But it is still a work in progress.
Java? Verbose and slow…
So it is PHP… Apparently the choice for many others…

But hey, so many are hoping that Ruby/Rails will get better, maybe it will…

74 | Karthik — August 30, 2009 3:51 PM

Rails is lovely and it is too good with the database abstraction. But what happens if you want to tweak the database mapping, a lot of hacks indeed. And what about the documentation for ruby. It's not as detailed as PHP.

75 | JuniorJack — September 19, 2009 8:33 AM

Really? PHP is more scalable than Java? Get real! Scaling and maintainability go hand in hand.

I have worked with both PHP and Java. Currently I use just PHP. Comparing the two languages is like comparing a stealth jet fighter to a propeller plane. Architecturally Java is way superior. PHP doesn't even have namespaces. Oh, pardon me, they just got introduced in PHP this year. How can you scale easily and elegantly without namespaces?

In my view it's like this:
if ( you want to develop a relatively small app or a website ) {
echo ” Use PHP \n”; // PHP doesn't even have a echoln function lol
} elseif ( you want a big app with high performance ) {
System.out.println(' Use Java ');
}

…and, for those who will want to pick up on my remark about Java having better performance: IT DOES! It will not be much faster if you benchmark algorythms, however in the case of large scale apps with many users it easily leaves PHP behind. Again, it's the architecture.

And if you have doubts, ask yourself why Google is using Java.

76 | truthspeaker — October 2, 2009 2:38 AM

Have not tried ruby yet, but will.

Java tools are a huge pain. You get stuck and don't move forward if you don't have someone to go to while you are learniing.

All that xml and directories just to make something work????

I have seen it cost companies so much money in training and extra hiring that they just give up and outsource.

Remember, this is not about the coolest toy. It is about running a business through IT and getting work done on a budget.

This is where java and all its kludgy tools is a failure.

77 | Kishantha Nanayakkara — November 28, 2009 12:02 AM

Java dominates and leads the other languages by its available tools and frameworks. The frameworks are very strong in Security, Application Integration, and project management and maintainability.

It's true that it's hard to grab each and every framework of Java at once. Best thing is to start with only few or no frameworks in the beginning. For example we can write a simple web application with model 2 architecture by using just Servlets and JSP rather than using Struts. We can use Spring JDBC templates instead of other ORM frameworks to get the notion of how ORM really works. So start simple will make your life easy with Java.

To read more please check my blog http://kishantha.blogspot.com/2009/11/comparing-php-java-and-ruby.html

78 | steve — November 29, 2009 1:07 PM

PHP is a hacked up insecure mess.Outside of web development where is PHP used?

Ruby is used in system scripts up to large applications. On the desktop, in the server room and on supercomputer clusters.

PHP is a toy for amateurs.

79 | Mallika — December 31, 2009 1:43 PM

I agree with Steve…PHP is a mess.
Yes, you can write amazing code in PHP, and since it doesnt force you to, it attracts a lot of hacks.
Java controls that to a very very large extent. You can almost be certain that the app in Java is easier to maintain even, than ruby!
Why? Its hard to find really good developers who wont make a mess in Ruby…so maintainability goes out of the window.
I have a strong respect for PHP, and a deep dislike for all PHP hacks (95% of them are hacks).
I miss the days of c and c++…we are spoilt for choice which need not always be a good thing!

80 | Jason — January 28, 2010 8:57 PM

I personally use PHP, but I think it's not what you do but the way that you do it. If you are good at a programming language/framework/etc. and exercise good coding practices than any of these are going to be scalable and easy to maintain.

Leave a Response

  Remember me?

Related Industry News Articles

 

From our Job Board  View all jobs | feed Jobs RSS feed | Post a job right now

 

Featured Events  View all events | feed Events RSS feed | Add your event

STAY UP TO DATE
Subscribe to our RSS feed...
SUBSCRIBE TO OUR RSS FEED