Live data from Hacker News

Everything that's wrong with Java in a single class

plus.google.com

51–60 of 159 posts

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

#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 about immediately, JavaScript tries to actually run with unpredictable results.

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

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

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.

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

#54
post #47

If anything, that's an indictment of the Spring framework, which you certainly don't need to write Java. For instance, there are over 500,000 Java apps in Google Play market, and I'm pretty confident most of them don't use Spring. Now if you wanted to criticize Spring and cargo-cult enterprise Java development, I think that's reasonable.

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.

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

#55

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

If you spent your life being inconvenienced by the things you made earlier to make your life convenient, you'll go to extraordinary lengths to make other things that seem to make your life convenient given all the inconveniences you've already created for yourself. It does not really compute that this is another inconvenience you're building for yourself that is going to need another convenient AOP driven bean thing that you will write in a few months to get around the nonsense you burdened yourself with in the first place. It also does not help that everyone (well, at least the people with the money) is buying it and forcing it down their developers throats. If they don't want it, there's always a bunch of guys who are cheaper and will take it....

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

#56
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 couple years this you get to brand yourself a "Java Architect".

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

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

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

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

#58

Earlier quoted context omitted.

No need to create javadoc, takes people 4 years to read it anyway :D

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 of code with connected functionality).

JavaDocs doesn't make the package/class hierarchy terribly clear - this is intrinsically tied to Java's overcomplicated class hierarchy and needlessly complicated package system, but it carries over into poor documentation as well.

JavaDocs also doesn't have a culture of providing complete examples of code, which exacerbates the two aforementioned problems.

That said, JavaDocs has inspired other good tools, so I'll give it some credit for that and write these criticisms off as vestiges from a time long past.

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

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

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

#60
post #36

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…

Did you read what I said? "vim/emacs are [for Java] no better". This was in part to head off the predictable chimes from some of "all IDEs are stupid, (vim|emacs) is the best thing since sliced bread". My tool of choice for Java is however IntelliJ, which is simply light years ahead of Eclipse (IMHO).

> My tool of choice for Java is however IntelliJ, which is simply light years ahead of Eclipse (IMHO).

I agree.

Eclipse seems to always become unstable once enough plugins are installed. After a few updates and removals it ends up tipping over regularly. I suspect the underlying OSGi plugin system is a tricky thing to get right.

Intellij IDEA seems to "just work".

That said, I prefer coding in Clojure with Aquamacs but I've yet to get Clojure into a production system.

Post reply on HN