Why Do Cool Kids Chose PHP to Build Websites?

PHP Developer's Journal

Subscribe to PHP Developer's Journal: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get PHP Developer's Journal: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

PHP Authors: Hovhannes Avoyan, AppDynamics Blog, Trevor Parsons, Andreas Grabner, Harald Zeitlhofer

Related Topics: ColdFusion on Ulitzer, Web 2.0 Magazine, Java Developer Magazine, Facebook on Ulitzer, PHP Developer's Journal

CFDJ: Article

Comments Pour in As Nexaweb Founder Asks "Why Isn't Facebook Built in Java?"

Coach Wei's Question Strikes a Chord in Javaland

Coach Wei, whose Java credentials are impeccable, opened up a can of worms by raising the issue of why Java's not in favor any more for building web sites, even complex ones. Even a complex site like Facebook, Wei noted, is not written in Java. 'Why do 'cool kids' choose Ruby or PHP to build websites instead of Java? I have to admit that I do not have an answer ... the power of Java is a perfect fit for the areas where websites may need more than markups or scripting, such as middleware logic,' Wei argued.

"Java did indeed suffer from obscure over complications for some time but it has come a long way," wrote Sam D. "People that are throwing stones are talking about Java in its previous life. To them I say you are not keeping up with the latest technology advancements and in the IT industry that is not very good practice."

But venkat thought the explanation was simpler: "Most of the startups have very limited financial capablity up front. And Java hosting is never free while PHP hosting is free almost everywhere.. It's all about money. Nothing else."

The hosting issue resonated with Drazen Gemic, who wrote:
"Many people mentioned hosting, and it probably is a part of a problem. Hosting companies often use Tomcat which is not very suitable to the task, because of remote administration problems. Some kind of "hot deployment" (JRun like) would help. I believe that a servlet can be developed that could watch the file system changes and restart contexts with short delays, without meddling with Tomcat source code. I am thinking of starting some kind of open source project for that purpose.

Scripting languages require less effort to start with. I know web designer who used PHP elements without even being aware of the fact that PHP executes on server, while HTML renders in client. It was trial and error a bit, but it worked in the end.

Scripting languages for JVM exist, and they are quite ok. In fact they are very ones that are "easier than Java". One can build an application in scripting language that make use of Java middle layer (maybe even third party) with no problem. They are not popular and not advertised enough. The question is why, and I'd like to know the answer."

And Adomo Btwitti  had suggestions, too: "Perhaps what is needed is a Java-based interpreter that processes a simple markup script as PHP does. For example, if it's called jphp: <? include('myapp.MyApp'); write(MyApp.getSomething()); ?> some html." 

"Does this exist already?' he added.

Eric S chipped in with this insight:
"Just like C/C++ have found their niche forever in system software, so is Java converging on its niche: frameworks.

What everyone has pointed out here is that PHP is practical for someone building a startup like Facebook and Java is not. You can assume that in the architecture meetings they are now feeling growing pains and plotting changes-- but that doesn't mean it was the wrong decision-- it was a MULTIBILLION $$$ very right decision! Think about that next time you are fretting correct architecture vs. technology fads!

Truth is PHP is a technology fad thats very useful for hacking things together. But don't believe that Java will "win" in the long run. It is getting boxed into enterprise application frameworks. Where the industry is headed is highly modeled applications and Java frameworks are but one of several commodity backends that can be targeted.

Java was a big step forward but it doesn't stop there. You can bet though that Microsoft is overjoyed that facebook is NOT in Java and any big move for them will be all .NET.

But why be hung up on Java? The minute you code your business logic in Java you have thrown away the semantics to be forever understood only by a virtual machine. May as well be COBOL. End to end modeling is where its going and Java will be a great back end for platform-agnostic execution of the models."
Shane Montgomery asked "Why not ColdFusion?" while Sam D. added "I would like to hear some feedback from the PHP and Ruby enthusiasts on what they think of Groovy."

Last word in this brief round-up of the 58 comments so far goes to JulesLt:
"Partly, it's a circular definition - they are the 'cool kids' because they're using Ruby - if they were using Java they wouldn't be the cool kids (although the same fault lines exist in the Java world too).

To follow up some other points - Ruby wasn't designed as a Web programming language, it's a general programming language like Java - or indeed Smalltalk (Ruby's Dad and Java's Great Uncle).

And to concur with others here, I'm guessing a large part of the attraction is that there is a single popular framework to learn. Rails and Ruby are nearly synonymous. You're not plugging Hibernate and Velocity and Spring in a stack. Of course that only explains why people are learning it, not why Java developers might switch over."

More Stories By Jeremy Geelan

Jeremy Geelan is Chairman & CEO of the 21st Century Internet Group, Inc. and an Executive Academy Member of the International Academy of Digital Arts & Sciences. Formerly he was President & COO at Cloud Expo, Inc. and Conference Chair of the worldwide Cloud Expo series. He appears regularly at conferences and trade shows, speaking to technology audiences across six continents. You can follow him on twitter: @jg21.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.