Live data from Hacker News

Everything that's wrong with Java in a single class

plus.google.com

71–80 of 159 posts

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

#71
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.

> It will be more verbose

Isn't it exactly why it is not good idea (or at least not convenient) to do so in Java, even if functional approach would be best suited for the task at hand?

Of course you can do everything in Java what you can do in Clojure. You can also manipulate strings and generate reports in an assembler, did you know this? It all boils down to how convenient it is.

Java was not designed for functional stuff, that's all. Saying that you can map a function over collection in Java isn't going to change this.

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

#72
post #23

Earlier quoted context omitted.

What is the Java culture? I don't think there's anything. There are so many Java programmers that there are bound to be bad ones along with the good ones.

You're right, of course. Programming culture can be hard to nail down, if such a thing even exists. But would it be a stretch to argue that there is a Java community? I don't think so, and I don't think it's much more of a stretch to argue that a community will adopt trappings of culture. Java the language certainly enforces a certain kind of programming, that Steve Yegge so succinctly identified as a "kingdom of nou…

What is wrong with Java encouraging OO style programming? Some people will do very well with it and some will not. Functional programming is not the holy grail and some people are very bad at it. Do those bad functional programmers invalidate the whole functional programming approach?

I found that the whole notion of finding some bad examples of a practice and then offer that as a proof to invalidate the whole practice very distasteful. The lynching mob incited from the blog post's false information just shows how far it can go.

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

#73

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.

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 plenty reasonable. Like other commenters have pointed out, frameworks are hard. Java makes them harder. In the context where Spring and Java are givens, I'm sure the author of the above is a very handy chap to know.

Be nicer.

[Edit: To be clear. I want to make sure there's no confusion that the point of my original comment was that the class is hilarious. Not that it's not justified, or that the author is foolish, or that Java is awful, or that Spring is awful. I don't have very strong opinions about any of those things.. other than assuming a committer on such a huge, demonstrably successful project is plenty smart and did the poor chaps who are in the unfortunate position of needing this class a great service.]

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

#74
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.

Yeah, but that's just an over-patterned object-oriented design. This has nothing to do with Java specifically.

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

#75
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.

Clojure does support primitives: http://clojure.org/java_interop#Java%20Interop-Support%20for...

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

#76
post #68
post #48

Earlier quoted context omitted.

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.

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.

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

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

Regardless of this post (which, indeed, has little to do with Java per-se), Java the language might be outdated for many applications. But I believe it's now pretty widely acknowledged that Java's contribution isn't the language, but the platform. The JVM is the best performing, most stable managed runtime in existence. Not to mention the invaluable runtime profiling an monitoring that is years ahead of anything else out there. The platform (possibly used with some other JVM language) still gives the most bang-for-the-buck for performance critical, scalable applications.

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

#78

Earlier quoted context omitted.

I totally agree on java logging. Lambdas would be nice. Checked exceptions? I love them. Lastly Eclipse is THE best thing since sliced bread. I LOL'ed when you mentioned vim/emacs in the same sentence. Have you actually used Eclipse on a big code base? It's introspection is such a productivity booster. I've not used jetbrains in a decade, but nothing else out there beats it, hands down. Both in terms of speed and qua…

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...

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

#79
This is truly an issue with Spring, not with Java. An argument could be made that such a class is a symptom of some cultural problem with how Java developers tend to do things, but the OP is not making that point.

The issue with Spring, though, is very real. The key problem that framework authors want to solve is giving programmers the correct slots to place functions in. Oddly, Java is not very good at providing the kinds of slots that seem natural, particularly because of it's lack of lambdas. Plugging a function into a Java project requires that you participate in the inane Type-Name-Game whether you want to or not.

Play this horrible game long enough, and you will get the problematic names that the OP has discovered. And it only gets worse for in-house software.

Post reply on HN