Live data from Hacker News

Stop hating Java

andrzejonsoftware.blogspot.com

121–130 of 158 posts

Re: Stop hating Java

#121

What's the general consensus in the HN community regarding GWT? We're pretty happy with it and I think it has a lot of advantages over other frameworks.

I can't speak for others, but I hated it. The people I know who liked it were the ones who were scared of JS because they didn't know it very well. The problem with GWT is that if you want to do anything semi-complicated you end up needing to write native JS anyway. So you end up with an ugly cludge of an app written in two different languages and cobbled together with a JNI-like mechanism. I also had a ton of trouble getting their funky debugger to work correctly. Writing in Closure is soooo much nicer. The Closure compiler can give you type safety, which seems to be about the only benefit of GWT.

Re: Stop hating Java

#122
post #110
post #52

Earlier quoted context omitted.

Interestingly, refactoring usually works quite well for functional Haskell code without tests just relying on the types. (Of course the types won't help you in more imperative sections of your code, i.e. it's hard to guarantee a specific order of actions in the IO Monad with types only.)

You mean just like in Java?

Yes. But the pure part of your program tends to be bigger in Haskell than in Java.

Re: Stop hating Java

#123

I think a lot of the Java hate is because of the architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF, FactoryFactoryFactory shit and so on. I remember seeing the earlier versions of the servlet API and it was very elegant and well designed; unfortunately once the astronauts were through with it writing Java web apps became such a form of mental torture (Struts, anyone?) that even…

I agree with you about Play, it seems encouraging though I haven't used it for anything other than the tutorials on the site. Still not sure I'd want to use it over Rails or Python.

I'm worried that people will think I'm a broken record on the topic of java, but this discussion is coming up a lot these days, and I think a lot of people are doing a mental re-evaluation of Java. One thing that comes up a lot is that Java itself isn't terrible, but J2EE (as well as Spring and other frameworks many developers consider over-complicated) has made the experience of being a java developer (especially someone new to the environment) unpleasant.

While some people mention frameworks like Play, I'm interested in what people think of going back to the Servlet + Libraries approach that was common in 2004, just before Struts/Spring hit the scene. It's verbose, and I'm not saying we should just go back to the way things were, but I think developers might want to embrace the low levelness and verboseness of Java.

My take on it is - if I'm happy to work within the conventions of a framework, then I'd probably be happy with Rails or Django. If I want to write Java, then I probably want a very detailed level of control over my code base. In this case, it might make sense to start with the bare-bones (servlets and jdbc), and grow into what I think I need through libraries rather than an over-arching framework like Spring.

In general, I think I would want to use MVC and DI, but I'd like these things to be as unobtrusive as possible, and easy to add or remove, like libraries rather than something that dominates my code from the very beginning...

Honestly, my thoughts aren't completely formed on this yet... I just find it interesting how so many people on HN are starting to discuss this now. Often, there's a reason that developers start to focus on a particular issue at the same time.

Re: Stop hating Java

#124

First, let me point out that once again we are comparing Java - a runtime, a language platform and an entire ecosystem comprising many frameworks - with Rails, a specific web framework designed with a specific philosophy (opinionated defaults that work in 90% of cases, YAGNI, etc.) for a specific range of uses ("rapidly prototyping a small-to-moderately sized web site"). So just because Rails developers hate somethin…

I agree with the you. While it's mean, I dislike the current state of the Java community for the reasons zeemonkee stated in http://news.ycombinator.com/item?id=2793472 The tough part about languages like Scala and Clojure is that the existing Java ecosystem bleeds through heavily. For instance, while Scala boils away a lot of repetitious code, it's still there under the hood. It feels like an architectural band-aid.…

Don't underestimate the JVM ecosystem, plus you have 15 years of optimization in the VM...

Re: Stop hating Java

#125

First, let me point out that once again we are comparing Java - a runtime, a language platform and an entire ecosystem comprising many frameworks - with Rails, a specific web framework designed with a specific philosophy (opinionated defaults that work in 90% of cases, YAGNI, etc.) for a specific range of uses ("rapidly prototyping a small-to-moderately sized web site"). So just because Rails developers hate somethin…

I agree with the you. While it's mean, I dislike the current state of the Java community for the reasons zeemonkee stated in http://news.ycombinator.com/item?id=2793472 The tough part about languages like Scala and Clojure is that the existing Java ecosystem bleeds through heavily. For instance, while Scala boils away a lot of repetitious code, it's still there under the hood. It feels like an architectural band-aid.…

"For instance, while Scala boils away a lot of repetitious code, it's still there under the hood. It feels like an architectural band-aid"

I don't understand this argument. Even so-called elegant languages like Scheme still have 'repetitious' MOV, JNE, etc instructions under the hood. Unless you're running on a lisp machine, everything you write executes very repetitiously in machine language under the hood.

Why make a distinction between one abstraction and another? All of them are architectural band-aids, to use your parlance.

Re: Stop hating Java

#126
Ruby and Java serve different developer segments, it's much more fun to compare Java and C#. Java and C# are languages that are pretty much the same, serve similar markets but one of which I vastly prefer to program in because of the little niceties: no checked exceptions, first class functions, closures, properties, etc.

Comparing Java to Ruby is a philosophical matter, comparing Java to C# illustrates numerous ways in which the language and runtime (real support for generics) could improve while staying true to its market.

The article honestly looks like a comparison between rails and java rather than ruby and java.

Re: Stop hating Java

#127
post #36

Two other reasons I avoid Java the dependencies ecosystem for a typical Java app is bloated and always changing, and it didn't really live up to the promise of write-once-run-anywhere. And by the way, the over-abstraction habit is really annoying when you're trying to write a simple util app and you can't just say foo = new Foo() instead you have to extra nonsense such as factory = new FooParamsFactory() then foopara…

"it didn't really live up to the promise of write-once-run-anywhere" Care to explain this one? All the code I have written for the past 10 years do not need to be recompiled and can run on Windows/Linux/Mac/*BSD 32 bit/64 bit. And I used IO, NIO, sockets, threads, files (not necessarily high-level stuff).

I have maintained Java apps running on FreeBSD servers, it was a nightmare. And don't even dream of doing that in OpenBSD (which IMHO is the sanest BSD and even nix around).

Re: Stop hating Java

#128

What's the general consensus in the HN community regarding GWT? We're pretty happy with it and I think it has a lot of advantages over other frameworks.

I still can't believe GWT is not an April Fools joke, and I'm stunned that anyone ever took it seriously.

Re: Stop hating Java

#129
post #37

The part that I don't like is when I can't write a webapp in Java because I don't know about Hibernate and JBoss and Maven and servlets and JDBC and more. I'd love to try a strict language, having used only Clojure and Python lately. Playframework might be an alternative.

> I'd love to try a strict language, having used only Clojure and Python lately. Playframework might be an alternative.

Try Go.

Post reply on HN