views:

1619

answers:

9

If I were to implement a web application from scratch today, which app stack should I go for? Three main candidates are java, python and Ruby on Rails (RoR). There is also .NET, but its biased towards M$.

Pro-java:

1) Stacks of thick books
2) Largest developer community
3) Typed languages, which prevents subtle bugs
4) Augmented with groovy interpreted language

Pro-python:

1) Concise code
2) Thin books
3) Can launch web app for free on Google Apps

Pro-RoR:

1) Concise code
2) Thin books
3) Ruby may be slightly better programming language than python, but they are converging.

Overall, there is not much choice between python/RoR. The choice I have to make is between Java and Python. I slightly favor java because it is a typed language, but my good friend favors python because it is more concise. Does thick java books means its solutions are more comprehensive (and I have to write lesser code myself)?

A: 

It mostly depends, as it usually does, on the project and on your preferences. Mostly, I would steer clear of anything Java related for web-applications. That might be a quirk of mine, but they just feel clunky and slow, at least in my experience. Also, if the actual project grows in scope, maintaining Java code is a huge pain in the ass compared to a more readable language like Python or Ruby.

Other than that, I can definitely recommend that you give Django a shot before making up your mind. I think you'll be pleasantly surprised by how much control you actually have of the framework, and how clean your code will turn out.

Dave
Adeel Ansari
+6  A: 

Pick which is familiar to you and run with it.

Or you can pick Django on Jython to get best of Java libraries and Python's speed-coding.

Or pick Java if you need to convince somebody that it is enterprise-y.

I would say if you're working alone / in a small team, then just pick the one that requires least resources (hint: Python).

Swaroop C H
+2  A: 

If it is going to be in production, use the technology what you know best currently. Learning a new framework, language or technology can cause delays and in the beginning your code quality will be lower.

wvb
+4  A: 

Is your app mostly presentation, database (CRUD type maintenance) , or lots of backend logic.

For mostly presentation I would go Pythin/Django (or even php).

For simple CRUD RoR has it licked.

For anything with heavy backend logic, or, which uses an existing legacy database I would go for the java servlets using Spring with Freemarker, Ibatis and Tomcat or Jetty.

P.S. Don't worry about scalability performance -- nothing will scale as well as the Tomcat/java solution.

James Anderson
+4  A: 

Anti-Java:

  • verbose, sometimes cumbersome
  • poor choice for template scripting (can be mitigated by using a secondary scripting language such as Groovy, Jython etc.)

Anti-Python:

  • no particular standard framework, must research and choose (or just use standalone utility modules on top of WSGI)
  • still relatively limited hosting options (other than GAE or own server)

Anti-RoR:

  • no native Unicode, in a modern web scripting language? For shame
  • potential performance scaling issues

Personally I ended up with Python, but all these options - as well as .NET - are easily defensible.

bobince
There also seems to be a python interface for Amazon S3, EC2. So these are valid hosting options for python.
Amit Kumar
For java template scripting have a look at Spring/Freemarker. Freemarker is probably the best templating software around.
James Anderson
Ruby 1.9 includes native Unicode support and Rails has backported it since Rails 1.2. Also "Rails doesn't scale" is a meme in the Rails community: it will scale.
Chris Lloyd
+3  A: 

Background : I'm a professional Java developer that does Django on the side.

Java

Java is used mainly in the enterprise, and there are very good reasons for it. Java is a good solution if you need a language that is mature, has good support for concurrency, transactions, access to multiple databases ... Java is also a very stable platform. And by stable, I dont mean that it has fewer bugs than Python or Ruby, I mean that it doesnt change as much.

There is wonderful tool support for Java. Great IDE, great refactoring tools, great static analysis tools ... You probably wont find as many tools of that quality for any other language.

There are a lot of slow Java applications, but in my opinion it comes more from developers using an architecture that they dont understand, trying to do things more complicated than they need to. You can develop high performance, very fast websites with Java.

Django

Django is more light weight, more fun to work with. You can have an application running in a very short time. The admin interface is magical for simple CRUD operation and can be used for even pretty complex logic. You can find a lot of "reuseable apps" that will implements some of the functionalities that you need.

Even if Django is now in version 1.0, it is far from stable. If you need to be still developing your project in 1-2 years, you can expect a lot of changes just to follow the state of Django.

Conclusion

Use Java if you already know it and if you have needs for complex architecture and long term support.

Use Django (or RoR) if you want rapid development and dont care if you need to rewrite a lot of the app in 1-2 years.

Guillaume
I must agree with you that Django is relatively unstable.
jpartogi
+1  A: 

I used to be a Java developer, doing mostly C# now. My arguments against Java are that it is (or at least was) a real pain to get set up and running. It's also better suited for large applications that need a lot of organisation and maintainability. That, however, comes at a cost.

From the sounds of your post, I think one of the dynamic languages would be better suited. Plus, they're more fun to play with (IMHO).

Travis
Using maven for building, Java is quite easy to set up (atleast now).
Amit Kumar
+1  A: 

I would recommend Java and springframework - it solves all the burden of typical Java web application and provides you with clear way to get what you want.

I personally use Hibernate - JPA - Springframework (or Spring Web Flow) - Tiles - Freemarker stack that gives me ability to create new web applications rather fast, but alltogeather they impose rather steep learning curve.

I would suggest - just give a try to spring for a start.

miceuz
A: 

Unless you are in a Java/.net shop or there is a specific reason why you would use Java/.net, I would suggest one of the platforms that is more optimized for web development: Python/Django (or Ruby/Rails, PHP/CodeIgniter/Cake).

You'll find Python/Ruby/PHP so much easier to learn, deploy, program, etc. There is plenty of literature about them and plenty of support resources. All have been used to produce major web sites (YouTube on Python, Twitter on Ruby, Facebook on PHP).

pbreitenbach