views:

477

answers:

9

My boss has an idea for a web app he would like to build. Long story short it will need a lot of CMS features and a lot of social networking features, and some other unique things as well. We looked into just leveraging different CMS platforms like drupal and joomla etc, but they really don't meet our needs.

We have decided to build our web-app from the ground up, but we're unsure of what technology to use to build it. My co-worker and I will be the main developers and we are more comfortable with EJB, jsf and glassfish. However, we noticed most cms, blogs, forums, social networks, etc are written in PHP. We do not have any real experience with PHP, so we are wondering if there is some advantage to PHP that we are unaware of. I know java apps can be a little sluggish, and the hosting can be limited/expensive. Is there any other reason to use PHP?

+1  A: 

PHP is often used for prototyping a CMS because it's development speed is very high and PHP is built around web development, so there are quite a few features that help you along your way.

Not saying it's a must, if a development team doesn't know a language, then it's a big point against using it.

Ólafur Waage
+4  A: 

As you are familiar with Java, I suspect you'll be faster developing in Java -- familiar IDEs, language knowledge, etc. Plenty of excellent libraries support web development in Java (for example, GWT).

Alex Martelli
+3  A: 

If you go with PHP, find a framework, or you will write and fix your app for years. When I was working with PHP many, many years ago, there was only one decent framework -- the Zend Framework.

The only situation in which I'd suggest one use PHP is when she doesn't know any other language suitable for the task.

zilupe
I know a few local web designers and that is their whole life. They've built custom PHP CMSs and they split their time working on it and designing websites.
Nosredna
+3  A: 

The best reason for choosing PHP (and the main reason I use it) is the versatile hosting options - from really small shared host to the big dedicated server (and upwards - but I can't really comment on that).

Also, I find PHPs flexible arrays a joy to work with. The OOP stuff is not bad either (I use it, of course. But mostly because it's the best way to beat some structure into my apps, not because of an ingenious object model) - but if you really are completely new to PHP, coming from Java, you might see it the other way around.

I really must second the other comments - don't roll your own completely. Look into frameworks like CakePHP (using it now to build a very custom CMS), or Code Igniter (can't really comment, but I heard it's good). There are lots of questions and writings about PHP frameworks.

gnud
+3  A: 

PHP is so easy you barely even have to learn it to get started. Seriously. You can start one morning not knowing any PHP, and that evening be doing all kinds of cool things. And, as you mentioned, PHP hosts are plentiful.

However, it's extremely easy to write spaghetti code in PHP. So try to keep what you've learned in Java in mind.

If you go the PHP way, you'll be able to dig into Drupal and Joomla and so on to add what you want.

PHP is usually slower than Java, execution-wise.

Nosredna
For simple applications, how much time is actually spent executing the PHP? Almost certainly a tiny amount. Have to hit anything low level and it will suck, but if you requirements exactly fit and PHP is doing what it is designed to do, the performance will be irrelevant.
Tom Hawtin - tackline
@Tom Hawtin--yeah, I agree.
Nosredna
+4  A: 
  • You already know java
  • Hosting is a non-issue if you're willing to shell out a few hundred dollars a month for a dedicated server
  • Java, at the most basic level, outperforms PHP. There are some pretty amazing JVMs out there that beat the pants off of the PHP interpreter.
    • At web scale, the difference is moot anyway. You can always add another front end server. Scaling the database is the hard problem.

As someone who's spent the last 4 years as a professional PHP programmer, I'd say there's really not much reason for you to choose PHP, unless you want to extend an existing PHP project -- which is something you should seriously consider.

Extending existing projects is a mixed bag. On one hand, years of work have already been done for you; on the other:

  1. You have to learn someone else's framework
  2. You may find yourself doing some pretty hideous things to bend the project to your will.
Frank Farmer
+1  A: 

How big is this thing going to be?

PHP is easy to start with, it is often cheaper to hire people to work on it, cheaper to host, etc. Unfortunately, systems can easily become unmanageable if they're huge.

Java is more structured but may be more difficult to start with. I would recommend not using core Java, but going straight to J2EE, perhaps some Hiberante for the database, or even JBoss. But Java would be more scalable, IMHO.

Uri
+2  A: 

Unless your boss has some pretty amazing and revolutionary ideas about a CMS, perhaps it would be worth your time to examine some existing applications. Some names that come to mind are Alfresco, Drupal, and Joomla. I hate reinventing the wheel.

Gary Chambers
+1  A: 

Whatever, but if its Java you are inclined towards. Look into Alfresco - for your own sake - immediately.

Cheers.

Adeel Ansari