r/java • u/_Garbage_ • May 11 '13
Why isn't Java used for modern web application development?
http://programmers.stackexchange.com/questions/102090/why-isnt-java-used-for-modern-web-application-development9
u/_jamil_ May 11 '13
Pretty sure twitter is currently running on java (since it had horrible results scaling with RoR). that's a fairly modern web app
2
u/iends May 13 '13
Maybe you mean the JVM. My understanding is that twitter is using Scala.
2
u/Akanaka May 14 '13
They use Java ;) if I'm not mistaken they even build their own web engine called Blender or something like that.
21
u/armornick May 11 '13
This 'article' is incorrect, in my opinion. Java is still widely used for web applications. Just not in smaller companies.
Also, we have to take not that Java is two things: a marvelous application virtual machine that's still used by such wonderful languages as Clojure and Scala; and a programming language that's still good though showing its age. Both are still widely used.
10
u/Mondoshawan May 11 '13
Just not in smaller companies
I'm not even so sure on that. In the last five years I've worked for two different employers with less than ten employees and they were 100% java. Current company has three full time staff & two contractors, with effectively 2.5 people working on coding.
IMHO the problem is learning curve. Core Java is easy to learn but learning the entire ecosystem & what fits where is entirely different. Once you become aware of the major third party libraries you can be vastly more productive than in any "toy" language. Ruby on Rails might get you a CRUD application in minutes but once you actually start to build on it you end up going around in circles trying to hack things into the framework.
6
u/lazyLoaded May 11 '13
I agree about the 'smaller companies' statement. I've worked for 3 large companies that all have a Java back-end. The biggest and oldest on my list still uses JSP for the front end. The more recent companies both use a Java back-end for web-servers and connected services (no EJB) with AngularJS or a Backbone front.
For my current employer there are just so many compelling tools for the "operations folks" to stick to a Java back end. But there is a trend in our company to use NodeJS/Mongo or other scaffolded-NoSql approaches to do "lean testing" with customers or prototypes.
7
u/NSFlux May 11 '13
Most comments in this thread are accurate, so I'm just lending my voice to those and adding a couple other points. Java, as a platform, IS still a popular choice for modern web app development. Java has even been inspired by other frameworks from other platforms (JBoss Seam was inspired by Ruby on Rails). Spring Roo seems very similar to Python's Django. These frameworks let you build a functional web app with many basic features (including user management) in about 15 minutes.
Class hot swapping has been around for a LONG time (since hotspot I believe) so the ability to make a change and instantly see it in your application has existed since at least 2001ish which is when I first remember encountering it when I noticed that it kept fighting with tomcat's auto-reloading feature so I had to disable that feature in tomcat.
I am biased though. I have been doing Java professionally since 1997 when it WAS the new hotness and it was the thing that everybody wanted to be doing. That being said, I think all the new languages can be made to scale, but I think Java is easier to scale and provides a more robust environment out of the box. And I'm fully resigned to the fact that in a few more years I will probably be the old codger talking about java when all the young whipper snappers coming out of school are wanting to do the latest and greatest dynamic languages... to which I say, "java can do those too (jython, jruby, clojure, groovy, etc) " .. :D
5
u/henk53 May 11 '13
This is not my experience at all. At different companies both large and small I've seen a lot of stacks being completely Java based.
JSF/PrimeFaces is seen a lot these days, especially for smaller and modern apps, but also for larger things. Then there's the assortment of GWT, Spring MVC and Wicket apps, all pretty modern stuff.
If anything, the trend I'm noticing is that of the vocal minority shouting louder. A couple of years ago they shouted how great and productive RoR was (granted, it had many very interesting ideas), and all this shouting and especially the fact that the hottest site of the time (Twitter) was using it, gave one the feeling that everyone was on RoR.
In reality though, RoR may have peaked at 3% or something, with Java based websites at one time maybe approaching the 30%. Currently it IS down, but a conservative guess is that it's around 20% now, more if you include the hybrid stacks that have Java in the backend for search and such.
Job trends, questions on SO, available books, number of open-source projects, etc for the Java web application space are all strongly indicative that Java really is used a lot for "modern web application development".
5
u/Throwaway1012310123 May 12 '13
When you're a 6 months old company trying really hard to get your "big idea" out before someone else does something similar, it makes sense to go with a lightweight framework and a language easy to code in. When you scale up you really need to think about the framework you're using. Add to that testability (unit, integration and possibly penetration as well), streamlining your deployment process, reducing QA overhead, ability to experiment with your features. I'm no expert on what startup use and why but not being maintain speed while scaling up could be a big reason why a lot of start ups crash under their own weight. Also I've found that if you're using a framework/language that is not widely adopted, it becomes really hard to get good technical talent let alone domain experts. On boarding time can be really high and can slow down rest of the team.
4
u/Akanaka May 12 '13
There are more and more startups discovering lightweight Java EE 6 almost every day.
Java was once known for heavyweight J2EE and that image has stuck in people's heads. But J2ee is long gone and the future is looking bright for Java web development; it's the power and maturity that costed thousands of dollars only half a decade ago, but now for free, open source and with a lightweight programming model.
1
u/iends May 13 '13
Can you explain what "lightweight Java EE 6" is? I'm trying to pick up Java EE but am lost in the alphabet soup. (I've only written some simple servlets w/ jsps).
2
u/Akanaka May 14 '13
Lightweight Java EE 6 is pretty much what TomEE offers, but amazingly JBoss AS 7 as well.
It's just that the programming model is simple to grasp, installation of a server is just an unzip and it starts up in a second or two at most.
Yeah, the alphabet soup. There's an MVC framework called JSF. That's 2 three-letter-acronyms already :p It has a templating language called Facelets on which you put components. You persist stuff via the platform ORM which is called JPA (2 more). You can easily validate constraints using BeanValidation.
Netbeans and Jdevelopment got some nice tutorials and getting-started guides. Check those out if you are interested.
6
u/sarcasmismysuperpowr May 11 '13
I'm sorry but how is GWT a minor improvement in struts? I don't know all the web frameworks but those are very different ones that do very different things.
1
u/NSFlux May 11 '13
They are very different things but I could see replacing a struts (or spring mvc, seam, jsf, etc) app with a purely GWT one, given that GWT does provide a framework for the server side work via it's rpc mechanism as well as it's client framework.
That said I probably wouldn't do it because it (I could be wrong on this) locks you into GWT on the front end. I would instead use GWT as a front end to a RESTful service. The cool thing about GWT is that it's very easy to make modular, re-usable, easily maintainable, front end components that can be distributed around.
Probably a more realistic comparison would be to say you could replace JQuery or ExtJS with GWT.
2
u/sarcasmismysuperpowr May 11 '13
I think ExtJS is GWT, is it not? I thought ExtJS was like Sencha, Vaadin, etc.. in that they are toolsets/framework extensions that sit on top of GWT.
1
u/NSFlux May 12 '13
No completely different things. Extjs is a JavaScript library for doing cool Ajax apps. It has a rich widget set.
Gwt is a sever and client side framework by google that lets you compile java into JavaScript to write cool ajax apps. It also has a rich widget library.
Using one does not prevent you from using the other, and you could probably augment gwt with extjs or any other JavaScript framework, and vice versa.
2
May 11 '13
My observation is that Java is ideal for solving organizational problems more so than programming problems. It thrives in the enterprise. Static typing, great build tools, great web service support and tons of off-the-shelf middleware and experienced developers. It scales up pretty far with minimal effort.
Startups don't have organization problems and tend to have strong DIY attitudes. They also need rapid turnaround and exotic scaling solutions where code execution is not a bottleneck.
1
u/jaypax May 14 '13
Java is for modern web application development. It's just, that most java web apps aren't deployed in the open internet. Thus, it's not that popular with the general population - it isn't that cool. Most of the java web apps I worked on are used internally by companies for employee portals (LifeRay), financial systems(Struts, Tapestry5), Analytics/Data Mining(Pentaho, iReport) and whatnot.
-4
u/_clj May 11 '13
This is why I love Clojure. You have the great platform that Java is, with the most elegant language in the world (Lisp). Concurrency is so easy in Clojure; I can make a highly concurrent app with none of the concurrent bugs that I would have in a Java app. Also if I ever need raw speed without multithreading, it's easy for me to write a web app in Chicken Scheme or something.
-8
-21
May 11 '13
I'm no expert, but have you seen how long applets take to load at launch? I feel like the new web-app direction needs quicker access times. Check out this Javascript's Canvas example. (Notice the lack of loading)
17
0
3
May 12 '13
[removed] — view removed comment
1
u/johnwaterwood May 13 '13
If you ONLY install TomEE(25~30mb) and nothing else, you also have a MVC framework, ORM, injection, etc,
I think that is the future of Java. All those dozens of Spring libraries just aren't needed anymore. The exist solely to wrap things that don't need wrapping, and to introduce an abstraction layer for things that don't need to be abstracted.
11
u/prattle May 11 '13
Err, it is. It is one of the top couple of languages used and a very large proportion of its use is related to web applications. Some guy saying he "noticed a trend" doesn't really mean much though and doesn't match the job boards in my area of the country at least.