views:

229

answers:

7

I am an experienced Java developer who is trying to learn web development with Java presently. I also had web development experience with ASP.NET (c#) and PHP. I know what basic concepts (JSP, Servlet, Bean) and looking for a framework to go.

My question is not "What is the best framework for Java" or something similar.

After reading many threads on here and searching on Google for many hours I feel scared and confused. There are so many frameworks and endless combinations. I'm about to change my mind to do this in .net or even PHP.

  1. Is Java really suitable for very small teams (1 or 2 members) to develop web applications?
  2. Is Java really suitable for developing web 2.0 applications?
  3. Isn't .NET and PHP are far less confusing in this context.
  4. If choose a framework and after 6 months I decide to use another, is it possible to migrate easily?
  5. It just feels doesn't right to spend a same effort that I spent to learn Java to a framework that anytime can be changed or become useless. Am I wrong?
A: 

Very few still use Java for web development. PHP is the winner in this sense because of the community and the immense choice of fully-featured applications available for free. Enterprise level apps are easier to implement using .NET, due to the new features in C# and due to the existence of SharePoint. Python is also used by many, including Google and YouTube. Ruby has its fans due to the Ruby on Rails platform and its language elegance.

I have many acquaintances working exclusively in Java, and get paid very well, but they practically don't touch the Web part.

My opinion is very subjective.

Alexander
I'd have to say that sounds as if you don't actually know the Java web-development landscape at all - there are significant numbers of (non-trivial) apps developed using Java using the various frameworks. Certainly for trivial apps, then it's probably not the best choice, but once you get into needing to hook into server-side systems, then it's still a major player.
Gwyn Evans
Gwyn. Please read carefully, "MY OPINION IS VERY SUBJECTIVE", and if you read more carefully, you'd understand that it's based on acquaintance's experience. Some make components for existing portals, others make web services for integration. A lot of my friends are in Java for some years, and NONE of them has EVER built a website in Java.
Alexander
I did, but despite your last sentence of the post, the rest of your post doesn't have any "In my experience...", "As I understand it...", etc, that would indicate that you were doing anything other than trying to suggest absolute, factual statements - "Very few still use Java for web development." - "Enterprise level apps are easier to implement using .NET".As a matter of fact, most of the Java devs I know do a significant amount of web development (typically with Apache Wicket) so I happen to know that Java web development /is/ still a significant area.
Gwyn Evans
+1  A: 

I don't think there is anything wrong with trying to stick with what you have already known. But there are many web frameworks out there that can help you deliver a product much faster. You mentioned ASP.NET and php but there is also RoR which is very popular and quick to get going. Not to mention that a lot of these languages have web frameworks that speed things up even more. I would start looking at these vs going JSP or some other Java approach.

But this is just my opinion.

spinon
+1  A: 

I suggest you to use frameworks that use POJOs. With spring, wicket and hibernate/ibatis you will be OK for a long long time.

My opinions:

answers 1: yes
2: what really is a web 2.0 application? (yes)
3: no idea
4: will hurt you few days, but will certainly be possible.
5: depends what frameworks you decide to use. (yes)

Joni
A: 

Unless you have a very good reason to use java for web development, don't. Statistcally speaking, PHP is king in web development. You will also find many more frameworks and much better support for web development.

If you want to take a step away then try python, ruby, or CGI. They are all decent backends that work just as well in most area's that PHP does.

The main thing here is to go with what you know. Unless it's java.

TheLQ
That's unnecessarily harsh on java. It's actually not a bad language. Yeah it's accompanying libraries and frameworks mostly suck but there are some gems in there. If you feel more comfortable in the language it may be worth it to find them.
Jeremy Wall
Java does have its advantages, but in the web development arena with what I've seen the disadvantages way outweigh the advantages
TheLQ
So if you choose Python and Django there's no framework or language risk? Someone who depends completely on RoR doesn't have to worry about it? Microsoft never retires features without notice? Ridiculous. None of those concerns are unique to Java.
duffymo
CGI??? Really? Didn't you notice that it's already 2010?
silvo
CGI? Really? Didn't you notice that it isn't a programming language? (e.g. you can use PHP via CGI)
David Dorward
+4  A: 

I think you'll find quite a few varied answers. I'm a .NET developer, I personally love to use .NET, ASP.NET and ASP.NET MVC. If you are comfortable and know Java well, why not stick with what you know? You're right that there are a myriad of framework choices, and this is true for pretty much all the platforms.

  1. Java is suited for both small and large teams. Having a good source control solution in place will benefit any team, so make sure you consider how you are managing your source when working in a team.

  2. The whole Web 2.0 isn't really fixated on a specific server-side technology. The broad concepts of Web 2.0 (even though it's just a magic term) is that of building rich, interactive applications. You could have a Java backend, a .NET backend, and PHP backend, a Python backend, really the choice is entirely up to you. Can they provide the same sort of services to calling clients? I think they can.

  3. PHP and .NET benefit from huge development communities (not saying Java doesn't), and there are a whole host of projects going on with this platforms. Taking .NET as the example, you can extend it, you can build on it, heck you can even pull bits out and replace it with your own. I wouldn't say that you can't do that in Java, it's just that it would seem (to me) to be easier with .NET.

  4. Migration is a tricky beast, you've got to be mindful of how your using the technology, and if you are doing something particularly special, how well would that translate using another technology. If you stick with a familiar design philosophy (such as MVC), you'll find it easier than say migrating from an JSP straight to ASP.NET MVC, etc.

  5. Computing software moves at an amazing pace, and we all have to keep up or get left behind. You've got to ask yourself, are you making this platform decision for personal or business reasons? If it's for personal reasons, do you feel that you are likely to enjoy developing this in future, is it for personal growth and development? Where do you see yourself taking it? If it's for business, can you see what sort of investment you are making in this technology? Are there likely to be any winds of change which would make you question your choices at this stage?

Sorry if that's all cryptic, I hope it helps.

Matthew Abbott
Thanks for this nice answer. However I can't vote up yet
hrzafer
+2  A: 

Is Java really suitable for very small teams (1 or 2 members) to develop web applications?

Of course it is, as long as those one or two team members know Java well. This is a ridiculous question that depends on how you'd like to define "suitable". I'll err on the side of conservative and interpret "suitable" as "possible".

Is Java really suitable for developing web 2.0 applications?

Are you asking if JavaFX is suitable, or can the web 2.0 UI technology be Flex or something else? I haven't used JavaFX myself, but I think Java back ends can co-exist very nicely with web 2.0 front ends. Services are services.

Aren't .NET and PHP far less confusing in this context?

Your wording needs some work. There, I've fixed it. Depends on how well you know .NET or PHP. PHP is arguably "less engineered" and more straightforward, but every web app isn't a web CRUD app. .NET can be as engineered as Java, but it has the perceived virtue of using features that are part of the framework. At least everything is from Microsoft. Maybe you're confused because there's more choice with Java.

If choose a framework and after 6 months I decide to use another, is it possible to migrate easily?

It depends on the framework and how well you layer your application. I would say that if you layer your code properly things should be modifiable. But frameworks tend to be glue code, so if you depend heavily on the framework it'll be hard to extract it no matter which one you choose.

It just feels doesn't right to spend a same effort that I spent to learn Java to a framework that anytime can be changed or become useless. Am I wrong?

Anything can change and become useless. Microsoft can decide to re-write their Enterprise Framework 4.0 in such a way that it's not backwards compatible. I don't believe it's a language flaw - Java isn't the only one that's prey to this scenario.

You're right - you're always at risk when you take on a dependency. You're also at risk when you write and maintain everything yourself. You need to choose well to minimize risk, but you can never eliminate it entirely.

My recommendation? Choose Spring and sleep at night. It's a terrific framework that's hung in there for eight years and counting, still going strong. It has a great web MVC framework and lots more. The idioms it encourages will make your Java apps better: more layered, easier to maintain, possible to play nicely with other frameworks, minimizing your risk. They're owned by VMWare now, so they aren't going anywhere.

duffymo
Great answer! Thanks
hrzafer
+1  A: 

"DON'T PANIC" -The Hitchhiker's Guide to the Galaxy

I have significant experience building web apps in Java, .NET, and Rails. PHP, not so much. So here's my very opinionated opinion:

Web development frameworks in Java (there are a bunch, but look at Spring) are mature and easy to learn. So if you want to run with Java, you're definitely not doing anything dumb, regardless of your team size, or the "web 2.0"ishness of your project. It's all good.

That said, here are some things to think about if you want to explore other options anyway:

  1. C# is a way better programming language than Java, and I used to be a Java fanboy. They're very similar in many respects, and the transition is easy, but C# just fixes so many of the pain points in Java, and just holds together a lot better. I know you're not asking about languages, but if you're considering different platforms, it's definitely a factor.
  2. Until recently, Web development was a real pain in .NET, because ASP.NET with web forms was pretty awful for non-trivial projects. There is a relatively new MVC platform released by Microsoft. It's nice, easy to work with, and has a growing community. On the other hand, it's practically your only .NET option (aside from Monorail, which has a shrinking community and a lot of bugs).
  3. .NET isn't strictly tied to Windows thanks to Mono, but there's definitely a Windows skew to the community and libraries, and the Mono project is always a bit behind. You'll have to decide if that's relevant to you.
  4. Rails is a blast. A lot of things that are complicated in other frameworks are trivial in Rails. It's certainly not without its issues, but for getting a solidly-architected product running in very little time, it's tough to beat.
Isaac Cambron