Live data from Hacker News

Everything that's wrong with Java in a single class

plus.google.com

101–110 of 159 posts

Re: Everything that's wrong with Java in a single class

#101
post #76
post #68

Earlier quoted context omitted.

Then it would have been more accurate to refer to the standard library. There is no such ridiculous class there as far as I know.

Really? Obviously no single class is that ridiculous (hence the title of the linked article ). But that nonsense is pervasive in Java, and largely driven by the standard libraries (less so the core stuff as the more peripheral layers). I specifically remembering Swing being introduced with all the MFC goodness and noticing that they'd defined and implemented a "Model" class to track state for ... a button.

I found it troubling for someone to equate one class or a few classes to the whole library, the whole language, or the whole community. Those pervasive nonsense you claimed in Java have certainly work very well and been used to build many systems.

Re: Everything that's wrong with Java in a single class

#102
post #47

Earlier quoted context omitted.

Good observation, I've read several posts which complain about factories and proxies. With Grails (which can be all Java no Groovy if you want), Zk, GWT, etc. I can do powerful web apps. No EJB and no Spring needed.

"Powered by Spring, Grails outperforms the competition." So I guess that there is some Spring.

Yes but I don't recall having to do anything directly with it so the reference is good for me. If I need logging I expect it to work not worry that some bean config file isn't set up right. If the Grails developers found Spring helped them, cool, as long as I don't have to deal with it.

Re: Everything that's wrong with Java in a single class

#103
post #78

Earlier quoted context omitted.

If you haven't used IntelliJ in a decade, how can you be so convinced that Eclipse beats it "hands down"? While they offer many of the same capabilities, most people I know who have used both extensively tend to prefer IntelliJ for Java development.

I think he meant "nothing except possibly IDEA beats Eclipse". Now, whether you agree with that or not is a different story...

IntelliJ FTW!

Re: Everything that's wrong with Java in a single class

#104

Earlier quoted context omitted.

Thats a gross comparison of languages. Java, C++ and whatnot are imperative languages, of course the syntax is gonna be different to declarative languages such as Haskell or Lisp. They're also only alien at first; once you get used to a declarative syntax you never want to write imperative code again. It would be like going back to monochrome after experiencing color monitors. We have some programmers at work who can…

Perhaps this isn't quiet HN quality of a comment, but I'd love to go to a grey scale screen. I've been trying to figure out how to do that for years. Never could. The simplicity of it would be wonderful. In the same way, Java is noisy, I admit that, but it's fast, powerful and fairly easy to understand when executed correctly. I'm not saying you can do the same thing in other languages, but it's a good language for s…

JSTL might have been ahead of its time.

Re: Everything that's wrong with Java in a single class

#105
post #32

My favorite joke in that vein is "I had a problem and thought to use Java - now I have a ProblemFactory"

More likely just one implementation of IProblemFactory.

If I wrote that it would have been downvoted to - points range by now.

Re: Everything that's wrong with Java in a single class

#106

Earlier quoted context omitted.

In his defense, I don't think the long class name is the problem he's pointing out.. it's the over-patterned, over-generalized nature of something that barely does anything. The class's description is "Convenient proxy factory bean superclass for proxy factory beans that create only singletons." Seriously? That's fucking hilarious.

Frameworks are not applications. By their nature they are more abstract. Don't judge the code as if it was something it's not.

It reminds me: "Why I Hate Frameworks" http://discuss.joelonsoftware.com/default.asp?joel.3.219431

Re: Everything that's wrong with Java in a single class

#107

Earlier quoted context omitted.

And that has absolutely nothing to do with Java. Why is it Javas fault that some idiot decided to create such a class?

I guess there's a rule in place that hides the down arrow for comments in reply to my own or something. Anyways. I'd downvote if I could. The guy is almost certainly not an idiot. That's a rude, shitty thing to say. Further, if you accept that Spring is a good idea (which in my opinion is equivalent to accepting that Java has major shortcomings that require something like Spring to overcome) then this class is likely…

I've used Java for 10 years. I've never used Spring. I've never created an AbstractFactorySingleton. I've never used XML. There's nothing in Java that says you have to use anything in particular, apart from the runtime (Extremely solid), and the basic language syntax (IMHO nice enough).

OK, maybe they're not an idiot. Maybe it's warranted. I'd say it's probably over engineered stupidity though.

Even so, the title is like pointing to a stupidly constructed house and calling it "Everything that is wrong with bricks".

Re: Everything that's wrong with Java in a single class

#108
post #44
post #39

My opinion goes like this: java is a verbose and hard-to-change language compared to ruby/python/js/etc so people think "I'm going to create this extra layer/abstraction just in case someone needs to change/use it for something else later" while dynamic language guys just solve the problem at hand and then improve it later because it's painless to do so.

Agree. Java coders seem to have a habit of over-solving the problem with useless layers of abstraction. I recall trying to create a silly video editor in Java, using a common vendor framework for media files, simply opening the file then extracting the Nth frame involved instantiating 12 layers of classes, like nested Russian dolls, every layer just as useless as it's parent class. What a waste of time it was to cons…

So you have one bad experience with one vendor's library and you equate that with the Java language?

Re: Everything that's wrong with Java in a single class

#109
post #22

I hate this kind of post. It's the tech equivalent of "You're a stupidhead". If you want to criticize Java then at least make some meaningful points. Just off the top of my head: - Java logging is a clusterfuck - Something as simple as wanting symbolic links in a Maven build requires a third party plugin, last updated in 2007 (maven-junction-plugin) that requires something no longer in the central repo; - No lambdas…

> Java logging is a clusterfuck

Care to explain? Logback is easy to configure and extremely efficient

> Something as simple as wanting symbolic links in a Maven build requires a third party plugin, last updated in 2007 (maven-junction-plugin) that requires something no longer in the central repo;

If you are still using Maven it's your problem. Switch to Gradle and your life will be much better.

> No lambdas yet;

True, but if you really need them use Groovy or Scala. Groovy 2.0 is almost as fast as Java and Scala is fun.

> Type erasure in generics and the consequences thereof (eg inability to create generics of primitive types unlike C#);

True, but doesn't this lack of feature harm framework developers mostly? The same people which the article is critiquing.

> Checked exceptions;

You can just ignore them when you write new code. If you have to deal with code that throws them, just deal with them. Most of the modern frameworks nowadays don't use them.

> No function references, lambdas, etc (still a year+ away);

Groovy, Scala and the favorite kid on the block, Clojure

> Eclipse is a hot mess (IMHO). And, no, for Java at least, vim/emacs simply are no better. IntelliJ is but for some reason they insist on making it hard to make plugins as their API changes every major version. Jetbrains seems to be going out of their way to make it hard;

This is the only point for which I tend to agree. Eclipse is difficult to work with. IntelliJ on the other hand is a valid alternative. These days I mostly code in Sublime Text 2 though.

Re: Everything that's wrong with Java in a single class

#110
I guess I don't get what the problem is with this? It seems a fad to me that people are bashing Java, for whatever reason everybody is jumping on the bandwagon. When I look at Objective C the syntax for doing simple things like initializing variables can be incredibly verbose, but all you hear on HN is how gorgeous it is.

I admit it is a bit funny to see a class with so many design patterns employed. But nothing about it is difficult to understand and the name is certainly descriptive. I don't see how it can be considered over-engineered without knowing the context. This just looks like one class in a larger framework to me.

Post reply on HN