SoftSlate develops a Java shopping cart application so you can imagine where we stand on this debate, if debate is the right word. Preference? Opinion? Does there need to be a winner or loser here?
The argument has been made that Java is more scalable. The counter-argument has been made that PHP is scalable too and after all, Facebook is a PHP application. The counter-counter-argument has been made that yes, Facebook is a PHP application, but they had to do a whole bunch of stuff to make it scale.
On the other hand the argument has been made that PHP is easier to learn (this may explain why there are hundreds of PHP shopping carts and not nearly as many in Java). And maybe more importantly, faster to develop prototypes with, which is very important indeed, when you think about how valuable it is to be agile. I will also note here you are reading this on a page created in PHP.
Which language do you prefer? And what’s the essential factor for you?
I’ll speak for myself: apart from all its other strengths, Java feels easier to keep clean. By way of illustration, may I present here my family room:
It’s a mess of toys as you can see, and it’s almost always like this, except for those days we cajole our two kids into picking up. On those days, the pristine conditions seem to last for about an hour, if we’re lucky. But during that hour, oh yes, it feels almost … civilized.
You’ll note the cubbies and various boxes and such. These are artifacts of an organizational system. The system is there, it’s just only being partly-used. I think Java is much like our family room. You can still make a hell of a mess if you are careless, but at least there are lots of cubbies and boxes there for you (ie, standards, design patterns, and frameworks), if you choose to use them.
Does this mean PHP does not have cubbies? No, it has them too, but I tend to think they might not be as big or fancy. You might have to construct some of them yourself. And (maybe more relevantly), fewer of your neighbors use them, so it’s not embarrassing when they come over and discover that you don’t either. It may be easier to play with all the toys, but it’s easier to make a mess with them too.