Live data from Hacker News

Ask HN: Why are there so few apps being built with JSP?

news.ycombinator.com

41–50 of 107 posts

Re: Ask HN: Why are there so few apps being built with JSP?

#41
The biggest problem with Java webapp development, in my opinion, is its ridiculous obsession with XML. I can't count the number of hours I've wasted debugging obscure errors only to discover that I had a minor syntax error in my XML configuration files. In a framework like Rails, 90% of what I have to specify in those XML config files is assumed by default anyway, and almost all of the rest is done as Ruby code, which means I get actually intelligent errors when something is wrong.

Basically, it seems to me like Java web development uses XML as a dynamic programming language when they're trying to do something Java's not well-suited for. The issue is that XML has absolutely no type-checking at all, and so you end up with errors that make absolutely no sense when the only issues you have are simple typos.

The problem is even worse because you seem to end up having to specify the same information in so many different places, and having mistakes in just one of those will prevent anything from working.

I am sure there are ways around this, but the whole point is that if you're using a framework like Rails, you don't need to deal with any of this. It all just works, and having wasted months of time on Java web dev, I want to deal with a system that just works, not a system that requires ten or twenty kludgey three- and four-letter band-aids to get it to behave intelligently.

Re: Ask HN: Why are there so few apps being built with JSP?

#42
post #41

The biggest problem with Java webapp development, in my opinion, is its ridiculous obsession with XML. I can't count the number of hours I've wasted debugging obscure errors only to discover that I had a minor syntax error in my XML configuration files. In a framework like Rails, 90% of what I have to specify in those XML config files is assumed by default anyway, and almost all of the rest is done as Ruby code, whic…

XSDs provide type-checking.

Re: Ask HN: Why are there so few apps being built with JSP?

#43
I am a Java developer in my day to day work but I'll give a few reasons:

1. The memory footprint of the JVM is significantly larger for a similar app vs. PHP. Also, it requires a lot of tricky JVM option tweaking to get it to work in anything less than about 512mb.

2. The build environment is really heavy weight and complicated. Maven seemed crazy at first though working with it for a while finally got me used to it. It's still crazy complicated compared to rails/python.

3. Lack of code reloading when you hit refresh. JavaRebel fixes this, for a price.

4. Java code is really verbose. You have to become an expert at a lot of IDE features before you can get decent productivity. You absolutely cannot use a simple text editor or anything less than one of the big 3 IDEs (Eclipse, Net Beans, Intellij) and get anywhere.

The future is bright though for the JVM. I have started to work more with Scala/Lift lately and I am really blown away at how fast and powerful it is compared to traditional Java development.

Re: Ask HN: Why are there so few apps being built with JSP?

#44

I find javadoc very ugly and annoying to look at. Dumb reason, I know but I can't get past it.

To be fair - neither ruby/rdoc and rails api documentation are much if any better in that regard. I like the ruby/rails ecosystem but the javadoc approach was IMHO really OK as well (I don't talk about some of the parts of the standard library / the API itself)

Re: Ask HN: Why are there so few apps being built with JSP?

#45
post #44

I find javadoc very ugly and annoying to look at. Dumb reason, I know but I can't get past it.

To be fair - neither ruby/rdoc and rails api documentation are much if any better in that regard. I like the ruby/rails ecosystem but the javadoc approach was IMHO really OK as well (I don't talk about some of the parts of the standard library / the API itself)

I dunno I find rdoc significantly better organized and easier to read.

Maybe it's the lack of a README concept that offers a high level intro to the library.

edit: maybe it's the font too. I have slogged through javadoc a few times when I've had to use java for something, but overall it's fairly high friction / annoying to learn an API via javadoc.

Re: Ask HN: Why are there so few apps being built with JSP?

#46
A few major reasons:

- The verbosity of Java wears on me very quickly.

- I can't stand working in an IDE.

- Documentation is abysmal.

- I'm not familiar with the ecosystem (so I don't know what to use and when -- What's 'Struts'? What's 'Tiles'?) and there doesn't seem to be a place to learn.

Re: Ask HN: Why are there so few apps being built with JSP?

#47
post #16
post #9

Earlier quoted context omitted.

It doesn't take me days to get a Java web app up and running. It takes me minutes. In days, my Java web app is done. I'm a senior engineer who codes for pleasure, so maybe I'm faster than average --- but if it's taking you days to get your libraries together and minor db changes touch every layer, you're doing something wrong.

Recently I started working on a new project using Tapestry 5.1 in GlassFish 3. That particular combination requires replacing GF's StAX lib with a different implementation that Tapestry depends on. Then there's the usual issue of reconciling the 2-3 different logging frameworks that various components depend on, writing the (albeit minimal XML descriptors for the app, web app, EJB, configuring resources in the app se…

Do you like Tapestry?

Re: Ask HN: Why are there so few apps being built with JSP?

#48

For me, it's purely emotional. My last class at Uni 2 years ago was a survey of web dev technologies. We built sites using ASP.NET, Perl, PHP and JSP. Java and asp.net were tied for worst experience ever. Setup and configuration of the Java stack was 2/3rds of the project. And, that's after taking 2 years of Java in school. Setting up a Java stack on a Ubuntu or a Windows box was equally as painful for me at the time…

What's the big deal with setting up a "JVM Environment"? Working with Scala for me involves the latest Scala distro and a copy of VIM. Is there something in particular that makes it so painful that I"m missing?

Re: Ask HN: Why are there so few apps being built with JSP?

#49

A few major reasons: - The verbosity of Java wears on me very quickly. - I can't stand working in an IDE. - Documentation is abysmal. - I'm not familiar with the ecosystem (so I don't know what to use and when -- What's 'Struts'? What's 'Tiles'?) and there doesn't seem to be a place to learn.

disagree on the documentation point.

Re: Ask HN: Why are there so few apps being built with JSP?

#50
post #26
post #8

I prefer scripting languages over a pure Java stack simply because I can reload the page and see what's happening with the new code. Yes, you can use JRebel, hook up a debugger and tweak settings to get some hot code replacement, but they've always failed me at one point or another, resulting in hours of fun. The compile-check-fix-compile cycle gets under my skin, especially when you're using frameworks and libraries…

You can do that with a JSP page, and Tomcat. You can use JSP very much like a scripting language (no need to hit a servlet, controller, etc), but obviously it can get a little messy to manage depending how large of app you write.

One big problem; if you keep most of the Java code on the servlet side and you throw an exception, the stack trace will give you the line number of the offending code.

OTOH, if you do all that heavy lifting in the JSP side, depending on your choice of server, you get a stack trace...either without a line number, or with a line number of the JSP which was compiled and turned into a Java program on the fly.

And we all know what machine-generated Java looks like, right? Like a big plate of pain with some extra pain on top. Good luck bug-hunting that one.

Post reply on HN