Live data from Hacker News

Everything that's wrong with Java in a single class

plus.google.com

61–70 of 159 posts

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

#61
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…

The class combines no less than 6 concepts / design patterns: - Abstract - Singleton - Proxy - Factory - Bean - Interceptors It's not just a long name. The class makes sense in the context of this framework. The core problem (as others here point out) is that the Java flavor of OOP makes writing this sort of code idiomatic. On the upside, you feel really smart once you grok all these concepts simultaneously. After a…

Overengineering at it's best.

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

#62

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.

Totally. I've worked on some frameworks, and I get that things get hairy supporting some really crazy general and re-useable concepts. I'm not even saying Spring is shitty, or Java is shitty or anything. I don't really care... but don't you dare tell me that class isn't hilarious, because it is.

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

#63

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.

My favorite part is that the first word is "convenient." At the point that you need this class, absolutely nothing about the situation could possibly be considered "convenient."

Oh totally. I'm enjoying believing that this commit was part of a patch submitted with the explanation:

"Added a new superclass because you wouldn't believe how hard it was to to create beans that create beans that create only singletons!"

Turtles all the way down.

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

#64
post #59

> "it's not java's fault" (from multiple comments) languages have opinions. Java is designed around the principle of "everything should be a class" which makes everyone's first instinct to have lots of mutable instances with lots of mutable member variables. Turns out this leads to shitty code in the large. Compare to Clojure, which supports mostly all the same features as Java, but emphasizes them differently. You c…

Clojure functions are Java classes. It's not much different from using a Java functional libs. Except that Java will probably be faster as Clojure still doesn't do primitives and stuff (not sure about that one, may be it already does) You can do all the functional stuff in Java, Clojure is doing exactly that. It will be more verbose, but once you learn the ropes it just looks different, it is not different.

here is some code i wrote last week: https://gist.github.com/3758511

it was a method i extracted from some old code somewhere else while i fixed a bug in it. the functional programmer in me sees opportunities to generalize (and prevent future bugs here), so i try to refactor it into a defaultdict and a higher order function, using guava. 20 minutes later I still don't have working code, i revert, curse the gods because this is a 30 second refactor even in python let alone clojure, and move on, i don't have time for this shit.

its not about it looking different. it doesn't matter that closures and objects are turing equivalent. its a syntax problem.writing functional java code has too much friction and is not worth it.

this is not even getting into how any hardcore functional code needs persistent data structures to be fast, which means a) you need to write your code against a 3rd party collections library instead of JDK provided implementations, and b) any interop with 3rd party code will now imply a conversion (copy) at the boundary.

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

#65
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…

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.

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

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

#66
post #51
post #18

The carryovers from C, and resulting insane behavior when mixed with Java's usual syntax are pretty hilarious, too. public int[] what()[] { return new int[0][0]; }

I've been coding in Java since it came out in 1995 and I never did that, didn't know you could or why you would want to. So what's your point? Java, C, C++, even C# are readable by average people like me. LISP, Haskell, Ruby, Scala, Smalltalk all look like they were written by aliens. If you really want to see something funny look at JavaScript code which combines integers and strings. Things that Java would complain…

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't think outside the C++/Java/C# box. They also tend to be the worst programmers even after decades of experience.

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

#67
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…

The title should have been "Everything that is wrong with Spring ... ". Then it would not have been especially accurate, but more accurate. I like Java better than I like Spring. Spring made a framework out of an idea, but not all ideas should be packaged. Ideas can also be embraced. Dependency injection is an idea that should be embraced, but not as a packaged solution. It is a pattern, not a a software project.

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

#68
post #48
post #46

Earlier quoted context omitted.

What does that have anything to do with Java? It's the framework's problem.

Way, way, way too narrow. The Java standard library design and "framework meta-pattern" is what's being mocked here. It's java-the-community that we are laughing at via the straightforward label "Java". The fact that java-the-syntax or java-the-runtime can be used to code or deploy good software isn't really the point.

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.

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

#70

Earlier quoted context omitted.

Hey now. I find Javadocs to be among the easiest to read formats of all the different documentation styles. Right up there with Python's standard one (or whatever tool python's default library as well as numpy and scipy use), maybe even better.

Python's is far superior to Javadocs. JavaDocs is one of the earliest (popular) standard tools for documentation, so I'll give it that, but it suffers a number of problems - problems which are partly relics of the Java language, but that's no excuse. JavaDocs is too focused on documenting classes, rather than documenting functionality (Python docs, by contrast, focus on modules, which are themselves arbitrary chunks…

I found Javadoc well better and more informative than Python doc. Python module is nothing but a watered down version of a static class, so whatever applied to a class, you can say the same thing on a module.
Post reply on HN