Live data from Hacker News

Everything that's wrong with Java in a single class

plus.google.com

81–90 of 159 posts

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

#81
post #59

Earlier quoted context omitted.

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 becau…

I agree that Java can be awkward if you're trying to write using functional idioms.

Still, in case you were interested, I commented on your gist with a potential solution.

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

#82
"Convenient proxy factory bean superclass for proxy factory beans that create only singletons."

It's concise, precise, clear functional description of the class. It's also a profound commentary on the shortcomings of the Java ecosystem.

If you enjoyed this, recommended reading:

http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...

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

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

It's more a problem relating to the fact that many projects and their code bases are designed and planned to last for over a decade if not two or more. One simply can't just make drastic changes back and forth, because literally, peoples lives are on the line(let alone how much financial capital is invested...) with lots of written code. I'd grab Java, C++, heck, even C over Python or Ruby, let alone god damn JavaScript for a project which is going to ship after approximated 5 years of development and which has planned maintenance for at least 10 years afterwards. Considering how we miss deadlines, I'd assume such a project would be maintained after 20 or 25 years. Yes, someone would still work with the code base in 2037. Imagine that, and that's not even an unrealistic stretch. Welcome to enterprise software development! Do that with Python, Ruby or JavaScript and I'll give you a cake or two.

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

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

You won't find anywhere near this level of abstraction in the standard library, at least not that I am aware. The Java culture is understandably implicated by this though, because Spring is not some niche framework being perpetrated in some fringe corner of the Java-verse. It is very much the mainstream of Enterprise Java. Of course there are lots of Java developers outside of that set who are doing great work. And a lot of Spring makes sense, or at least it did 8 years ago when I last looked it. This class does seem to reference a sort of endless abstraction maze that resonates with people though.

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

#88
post #72

Earlier quoted context omitted.

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 practi…

> What is wrong with Java encouraging OO style programming?

There's nothing wrong with it, if you think OO is a good approach to structuring programs. I happen to think it's not that great an approach. But Java gives you no option, you can't have just "some OO" and some of something else. I think that's a serious mistake. You're welcome to disagree.

I didn't say FP is a holy grail. However in my limited experience, OO is definitely not either.

All that said, there's nothing wrong with constructive criticism, which is all I've been trying to provide. I don't think I've participated in any lynch mob, I'm sorry if you construed my light jab at "Java culture" to be offensive.

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

#90
post #52

Can somebody smart please come and explain what this class actually does ?

As one of the commentors pointed out in the original post, that class is helpful for making AOP driven applications. You could also use it in a DSL system if you wanted. Basically with Spring there are a lot of classes, the majority of which you will never use and should probably never use. But if you have the need, you've got a lot of power.
Post reply on HN