Live data from Hacker News

Why isn't Java used for modern web application development?

programmers.stackexchange.com

171–180 of 188 posts

Re: Why isn't Java used for modern web application development?

#171
post #152

Earlier quoted context omitted.

I've used both Java and Ruby and Java is by far the more advanced runtime with better support. Ruby may have much cleaner syntax than Java, but better tooling is NOT one of Ruby's strengths. Reading your post I suspect you've had very little exposure outside of Ruby.

> Reading your post I suspect you've had very little exposure outside of Ruby. Reading your post, I see that you just throw claims around. > I've used both Java and Ruby Congratulations. You aren't the first or the only one. > Java is by far the more advanced runtime with better support. There are a lot of good things about JVM. I never contended that. > but better tooling is NOT one of Ruby's strengths. I don't reme…

"Reading your post, I see that you just throw claims around."

Right from your first response, you've been misrepresenting the posts you're responding to. Your characterisation of refactoring in Java is astoundingly off-base.

Re: Why isn't Java used for modern web application development?

#172
post #126

Earlier quoted context omitted.

You'd much rather read a Java program because you are already biased towards it. Yes it's easy to read, but you need to acknowledge that many other skilled developers would find it easier to read Python, or Ruby, and indeed would rather read 1,000 lines of the same over 100 lines of Java. Otherwise you are simply being willfully ignorant. Why is Java considered inefficient and English not? Maybe because we don't need…

> "You'd much rather read a Java program because you are already biased towards it." No. I'd rather read "int foo; bar.printLn()" than "%foo => &bar :print" Less special characters. More words. Each to their own though.

> Each to their own though.

I'll agree with that wholeheartedly.

Re: Why isn't Java used for modern web application development?

#173
post #163

Earlier quoted context omitted.

> "You'd much rather read a Java program because you are already biased towards it." No. I'd rather read "int foo; bar.printLn()" than "%foo => &bar :print" Less special characters. More words. Each to their own though.

So you'd also rather read "An unordered tuple Z going from a1 to an is a defined as for every x in Z then x is a1 or x is a2 ... or x is an" than "An unordered tuple Z (a1,...,an) is defined as [x : x = a1 v x = a2 v ... x = an]"? I take that as not being (or not wanting to be) familiar with the language you are reading. If you'll read Ruby, at least browse a manual to know what {} and # mean.

The psuedo-Ruby code posted there is characteristic of someone who is having a knee-jerk reaction against something they don't understand. The person we are arguing against is obviously a Java zealot that will never consider using another language, so as long as he's going to accept that different people like different languages I think that's good enough for today.

Re: Why isn't Java used for modern web application development?

#174
post #152

Earlier quoted context omitted.

> Reading your post I suspect you've had very little exposure outside of Ruby. Reading your post, I see that you just throw claims around. > I've used both Java and Ruby Congratulations. You aren't the first or the only one. > Java is by far the more advanced runtime with better support. There are a lot of good things about JVM. I never contended that. > but better tooling is NOT one of Ruby's strengths. I don't reme…

On a large project the ability to refactor is important. Making structural changes to a large Ruby project is extremely time consuming and error prone. Pretty much anything is better at dependency management than bundler/gem. If you have to compile your dependencies at install time you're probably doing something wrong. Not to mention the version incompatibilities between gem versions and syntax changes.

You do, of course, understand that when a Ruby project gets large, it's still about 10% the size of a similarity functional Java project, right?

I don't like all the magic involved in Ruby for web (in particular Rails), but it's much more concise than Java.

Re: Why isn't Java used for modern web application development?

#175
post #159

I do a lot of work in Python now, which is great. But the one thing that I really really really miss from Java is better dependency management and packaging. I wish I could just create a .war file for my Python project and copy it to a deploy directory on a server to get it going. Using a virtualenv and pip or easy_install works ok but a simple maven config to define my project and it's dependencies is still lightyea…

... and if you wouldn't mind to spend some more time...

http://maven.apache.org/plugins/maven-deploy-plugin/

"mvn deploy" is probably all you need? :D

Re: Why isn't Java used for modern web application development?

#176
post #170

Earlier quoted context omitted.

For what it is worth, I have used Java 7, JPA (with hibernate), tomcat 7 and glassfish, and I didn't notice much difference. Jersey (JAX-RS) is pretty nice, one of the better libraries to come out of Java in a while. I do agree that Java is moving in the right direction, but it is a very slow progression. I think the major cause of the slowness is because of the fact that SUN was bought by Oracle, and it took a littl…

For folks outside of JavaEE, its common to deploy jars though. I have never run the software that takes .wars.

You deployed jars for web applications?

War files are not JavaEE, you might be thinking of EAR files.

A war file is just a jar file with a different name and manifest, and expects a few things, WEB-INF directory with a web.xml and that is about it.

More info can be found here: http://en.wikipedia.org/wiki/WAR_file_format_(Sun)

Re: Why isn't Java used for modern web application development?

#177

I programmed java web apps for 10 years before I switched to python, 4+ years ago. I feel that I'm much more productive using python and can get much more done in a shorter period of time, and to be honest, I'm much happier when I develop in python. Here are some of the reasons why I think python is better then Java based on my personal experience, your milage may very. Web Frameworks: When I first start programming…

This is a very thorough, albeit not necessary accurate, story of one's experience using Java.

I agree that there are TONS of duplicated effort out there:

Tapestry, Struts 1/2, JSF, Wicket, etc are all "MVC _and_ Component Oriented".

Hibernate vs JPA (yes, I know Hibernate is JPA 2 compliant, and yes, I know JPA 2 has less features).

XML processors. Java common utilities, the list goes on.

But these days there seems to be a quite select few of winners in my book: Google Guava, JUnit (TestNG is neat, but JUnit is good enough for 80% cases), GWT, Spring Framework or Java EE6 (your choice, or mixed).

Java based ORMs can't beat dynamic language ORMs in terms of "it's fun to use" (or less setup). Period. But having said that, Java based ORMs took different approach compare to ActiveRecord or Django Model. Java based ORMs are more similar to Ruby DataMapper; they required a little bit of setups (have to define your own model, etc) but in the long run, I think these second concept (or known as the Data Mapper pattern: http://martinfowler.com/eaaCatalog/dataMapper.html) may have been a better choice. Of course that is for the long run... not weekend project, get-prototype, get-funded, and get rich-quick scheme.

Java-based App Servers are heavy but with a caveat, depending on your loads, Java-based App Servers may use less resources (or degrade gracefully) because they are utilizing thread vs bringing up Rails + Ruby process per request.

When it comes to dev-time that depends on your experience. For example: I use JUnit, Eclipse, and JUnit plugin as faux-REPL. No re-compilation needed. Setting up the tools I mentioned is done via Maven + vanilla Eclipse. In another word: don't get too gung-ho with the number of tools I mentioned. It's fairly simple to get it to work.

I do have to say this though: as much as people hate Maven, there's no better and more complete build/dependency management/project management tools in other ecosystems (Ruby, Python, Lisp, Haskell) compare to Maven. None.

When it comes to IDE, I love the shortcut navigation keys of my IDE, Eclipse. I'm contemplating to purchase RubyMine in the future as well because quite frankly I can't live with VIM/Emacs. NetBeans has a decent Ruby IDE for a while until Oracle decided not to invest in Ruby anymore. Not sure what the stats these days. I need my "press X to go to Class/Method definition" to read the actual source code.

Yes, Java has been slow moving forward under SUN. Things have changed under Oracle. They're pushing it aggressively and toward the right direction.

People keep saying that the "WAR" deployment is one of the best thing that happened in Java. I heard Oracle is preparing Java EE7 that supports multi-tenant architecture.

Re: Why isn't Java used for modern web application development?

#178

Earlier quoted context omitted.

On a large project the ability to refactor is important. Making structural changes to a large Ruby project is extremely time consuming and error prone. Pretty much anything is better at dependency management than bundler/gem. If you have to compile your dependencies at install time you're probably doing something wrong. Not to mention the version incompatibilities between gem versions and syntax changes.

You do, of course, understand that when a Ruby project gets large, it's still about 10% the size of a similarity functional Java project, right? I don't like all the magic involved in Ruby for web (in particular Rails), but it's much more concise than Java.

That doesn't mean that Ruby is so compact that it's impossible to get a large code base in it. When Ruby projects get large making changes to the code is both painful and scary (I would know since I've had to do just that).

Re: Why isn't Java used for modern web application development?

#179
post #121

Earlier quoted context omitted.

Is Rails that slow? There's absolutely nothing on my machine slower to start up that the jvm.

I'm not sure about slow (though probably it is slow), but it surely eats a lot of RAM. Lots and lots of RAM.

I'm willing to put up with a few hundred megs of RAM usage for a system which runs 100x faster...

Re: Why isn't Java used for modern web application development?

#180
post #67

Earlier quoted context omitted.

> So basically, it's due to lazy programmers who moan if they have to type or think too hard. Typing is a problem. Thinking too hard? Where does the OP imply he is averse to thinking? Being turned off that "fucking XML files are controllers" is being averse to thinking? > Also very very much fashion lead by hipsters who must be using the newest coolest untested thing on the planet. And those untested things would be?…

> "fucking XML files are controllers" XML has absolutely nothing whatsoever to do with Java the language. Some frameworks might use XML. There might be some built in functions/objects that deal with XML. But that doesn't mean you have to use XML. I certainly haven't in the 12 years I've been using Java.

>>XML has absolutely nothing whatsoever to do with Java the language.

Idiomatic way of writing Java application requires usage of XML's in an extreme way.

Its almost like Java and XMLs exist for each other.

Post reply on HN