This is not supposed to be a flame, but I just keep wondering about this for some time and I wanted to hear other people's opinion too.
- Posted by: bogdan calmac
- Posted on: November 23 2004 11:40 EST
First of all I am a Java developer/fan I would love to use Java in all my projects.
But one thing that is bugging me is that when you visit various sites on the net, PHP-powered sites:
- are much more numerous than Java-powered sites
- overall the presentation looks nicer/more professional
Now the presentation certainly has nothing to do with PHP or Java. What is it then? I can think of two explanations so far:
1. PHP might have better frameworks/libraries (just an assumption, I'm not familiar with it)
2. Java developers are more of the academic type concentrating more on design and elegant coding as opposed to (presumably) practical PHP developers that rather concentrate on the final result.
What do you think?
The straw that broke the camel back was when this morning I was looking through the sites listed on the Velocity site as Velocity-powered and about half of them switched to PHP.
Again, this is not a flame, I know there are nice Java-powered sites out there (I like netflix.com for instance) but when you look at the overall picture, the difference cannot be denied.
- It comes with Apache by default... by Brian Kuhn on November 23 2004 15:06 EST
- Re:What's so special about PHP? by Thibault Cuvillier on November 24 2004 09:57 EST
Its popularity has little to do with one technology being better than the other. PHP comes (by default most of the time) with Apache. It's easy to set up. Therefore, a LOT of hosting providers support it.
As for the polish of PHP sites, you're probably right. Java people are usually engineers. PHP people are usually web designers.
PHP Fastfood is even simpler than Perl Cafe and Java Hut.
The extra time you spend with building web sites/apps in Java, is used by other people to improve the other aspects of the site/app (e.g. the web design).
Java is a great language. But for some reason, the Java community has decided to take it and make all the ancillary packages as complex and difficult to use as possible. It's like a racehorse that's had a wet bar and a hot tub mounted on it. The Perl folks have the right idea. Make supporting technologies that are simple to use, rather than so elegant that they become incomprehensible.
Imagine if the Perl cafe and Javahut were across the street from each other. You walk into Javahut, and ask to sit down. "I'm sorry," says the person at the door. I'm not actually the hostess, I'm a Factory class that can give you a hostess if you tell me what type of seat you want." You say you want a non-smoking seat, and the person calls over a NonSmokingSeatHostess. The hostess takes you to your seat, and asks if you'll want breakfast, lunch, or dinner. You say lunch, and she beckons a LunchWaitress. The LunchWaitress takes your order, brings over your food, but there's no plates to put it on because you forgot to get a CutleryFactory and invoke getPlates, so the Waitress throws a null pointer exception and you get thrown out of the place.
Dusting yourself off, you walk across the street to the Perl cafe. The person at the door asks what kind of seat you want, what you want to eat, and how you want to pay. They sit you at your seat, bring over your food, collect the money, and leave you to eat in peace. Sure, it's not the most elegant dining experience you ever had, but you got your food with a minimum of pain.
2 things... PHP is great for web sites, but sucks for web applications... yes, there is a difference. This is combined with what the guy said a couple of posts back about hosting providers is why you see so many more PHP web sites. Also, PHP has a smaller learning curve than Java.
The other thing, as far as the JavaHut vs PerlCafe comment...
Sure you are sitting there about to eat your food when you reolize you do indeed have a fork, but you dont have a knife. So you look around for someone to help and you find this guy called PerlDoc. You walk up to him and say "Knife" he spouts off 50 lines of grabage about faqs, and what not. Finally you convince him to discuss the general concept of "cutting something". You tells you about a guy who once wanted to cut down a tree. He tells you a long drawn out story which involved digging the tree out of the ground sending it through a molecular reoganizer that when primed with the right commands spit out a mass of tooth picks and one chicken. So you return to your table with a notion that some how cutting = molecular sceince. You start slaping the table in random places basing away at the $ % @ [ ~= # patters on the cloth when you finally hit somethign that masteriously turns your porterhouse into a lump of meetloaf. Not EXACTLY what you intended, but at least now you can cut it with that handy fork they gave you. No what to do about a straw.... "PerlDoc Guy! What do you got on "suck liquid"?"
I'm sure you have read the article instead of just reading the snippet.
Regardless what language you use, it's more important if you use it _right_. There are success stories on both.
PHP is easier to use, to setup, etc. And most web devs can't be bothered with the complexity of J2EE.
Sure I'm building an i18n, clustered, etc etc application using J2EE for my employer's clients. But if they only want a simple shopping cart application, PHP is a more reasonable choice.
If there's no big money behind it, not many companies want to use J2EE/.NET to build it. It's cheaper to use PHP (human resource, hostings, etc).
Let's face it, most sites/applications on the web ranges from simple to average.
If there's one thing I don't really like about J2EE, it's the arrogant snobs/elitists in the community :).
Hani is ok though.
There is much mor php web site, because there is a lot of cheap hosting solution. Hosting of Java web applicaiton required (most of time) a dedicated server because it require much more memory.
But, PHP become a nightmare if you web site become complex and need backend integration.