views:

623

answers:

10

I was chatting to someone the other day who suggested that Rails and PHP are the most suitable platforms for web applications, and to avoid Java. My background is mainly Java, and I know that it is considered by some to be too verbose and "heavyweight", but is used occasionally (e.g. by LinkedIn).

So I'm wondering whether anyone has had success using Java for a recent web application that has gone live, either using the language itself (e.g. with Stripes/Spring + Hibernate), or the runtime with a dymamic language (such as JRuby, Groovy, Jython)? If so, please share what worked and what you would do differently.

Some background (added later): Tim O'Reilly coined the phrased "Web 2.0" and here is his definition: http://www.oreillynet.com/lpt/a/6228

I think it's the "End of the release cycle" and "Lightweight programming model", involving rapid iterations and simplified deployment, where Java may be less suitable. Thoughts?

+19  A: 

I would argue that there is no specific technology for Web 2.0. The main concept behind a Web 2.0 application is that much of the content is provided by it's users and not one specific person. If you can achieve this with Java, then that is fine. Many people are creating startup companies with technology that is free because they don't have the capital.

CountCet
+1 because web 2.0 is more a "style" or kind of web application. Some languages may be more suited to certain kinds of applications than others, but theres nothing dictating that you must use language X or Y.
Dan
+3  A: 

Where I work, all our applications are built using Java. They are web apps, built using either hibernate or direct JDBC on the data end, and using Struts or JSF for the presentation side. I would not work with JSF again unless we had access to the latest version (we were stuck on 1.0 because of our IDE) as we encountered MANY issues with it and were told that they had been fixed in later versions. As for the rest of the technologies, they work fine if you know how to use them.

In general, you are going to be better off developing in a language you know well and is capable of doing the job than in one you barely know but may be the "best" language for the job.

Elie
+5  A: 

Of course it is. Java has some extremely mature and well tested frameworks for doing web applications, including so called Web 2.0 websites. Hibernate, Spring, even Struts and Tiles, or even Plain Old Servlets will do.

In addition, Java is very fast (see the Debian speed tests) compared to Ruby, which is good for websites handling lots and lots of requests, which Ajax does tend to inflate the number of! :)

JeeBee
+1  A: 

I build Web apps at work in Java and then I use PHP for my personal projects. While Java is certainly capable of all that you might require it to do, I've found it a little cumbersome at times and have wished I was using PHP (or another language, for that matter). It does depend on what type and size of application you're building, but I think there are good reasons why many people choose PHP, Ruby and Python for their personal projects, i.e. where they get to choose what language they build Web apps in (and not their superiors).

Philip Morton
+9  A: 

there are two totally different concepts called 'Web 2.0':

  1. user generated content (usually with some 'social networking')

  2. dynamic AJAX-based web apps

the second one somewhat dictates the technologies that you have to use (at least some JS, and machine-readable content in (some) responses). of course, there's nothing against using Java (or CGI, Perl, whatever) on the server.

the first one doesn't have anything to do with technology, and everything to do with the service itself you're providing. again, you can use anything you want.

why are these two mixed in the same therm? and more to your point: why are dynamic languages assumed 'more appropriate' for it? i'd guess it's just a temporal coincidence, all three things (user-generated content, AJAX, serious dynamic languages) jumped to the limelight roughly at the same time, and most of the proponents of each concept are using the other two.

in short, better avoid undefined marketroid terms like "web 2.0", and use proper descriptions. at least while working. when selling to the VCs and PHBs use any and all buzzwords that come near!

Javier
+2  A: 

"Web 2.0" more often than not refers to the user interface than the underlying technology powering the webapp.

What's stopping a Java-based webapp from being totally flashy and AJAX-y in the UI layer? Nothing. You'll be writing the middle layers in Java - which is transparent to the user anyway.

I think that the people who gave you this advice are more concerned about being "hip" and (what they perceive to be) current with what is "hot" right now - which is totally irrelevant to the markup of your UI. I wouldn't listen to them.

matt b
+2  A: 

Your friends, with all due respect, are dolts. Java is a rich language with incredible tools support. You could build a fantastic backend in Java and use anything you want for the front end.

It took me a while to figure out what to say in this answer because I was agape at the sheer craziness of the notion.

Robert S.
A: 

Yes it is.

Ben Aston
A: 

No.

(Sorry, couldn't help myself :-P)

Dan
I think it's ok to say "no," but you should give reasons why.
Robert S.
Of course, but I obviously didn't post this to actually add something useful. I've said all I needed in comments to other peoples answers. Fell free to vote to oblivion, if you wish.
Dan
You should make joke replies community wiki. ;)
Robert S.
Ah, lesson learnt.
Dan
+1  A: 

Wonderful day, I get to post about Wicket again! :)

Java is very suitable for Web2.0 applications as long as you know how to use the tools which are available for you. The Apache Wicket I just linked is a POJO-based web application framework with such incredible way to hide all that boring server-client stuff that it allows you to do just about anything you can think of. The strong point here is that since Wicket is just POJOs, you can get very fast, iterative and unit tested code that works just as one would expect in browser.

To create Web2.0 sites with Java you don't of course have to use Wicket but I'd recommend it anyway.

P Arrayah