Live data from Hacker News

Everything that's wrong with Java in a single class

plus.google.com

91–100 of 159 posts

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

#91
post #51

Earlier quoted context omitted.

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…

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 systems, especially middle-ware/server side development. It's horrible for Web Page development since JSPs suck and custom tags never caught on in most development shops (they're used because the framework provided them, but even when .tag files came out few used them to encapsulate screen behavior). But Web Development has moved on to JS on the client and REST on the back, so again Java is pretty good too.

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

#92
I have a simple question: is the root to all of this infrastructure problems (proxys, abstractions, etc.), the fact that Java introduces a fear of changing state (i.e. the existence of the "private" keyword) ? Since Java guards private variables so effectively and proselytizes a fear of state, the natural evolution of the community to build these layers.

Clojure is not a good comparison, since it avoids fear using immutable state. Ruby/Python is also not a good comparison since, well, it does not respect the privacy of state in any manner. The frameworks that have naturally evolved there, reflect the philosophy of need-to-keep-things-simple (which is the only way to work in a world where state cant be abstracted out).

Perhaps if you ask someone to build a Java framework WITHOUT using the "private" keyword, maybe it will lead to a whole different revolution ;)

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

#93
post #74

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.

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

well, but all java coders are this way. I'm working on a rails app built by java coders learning rails and it's, sadly, a pain in the ass, it's not that the code is malfunctioning, just that everything looks like it's a quantic mechanics equations when in reality it's just a 10 piece lego. Sure, they're not 100% is this way, but empirically I can state that, I too thought overengineering was beautiful when I was learning it, lame.

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

#94
No programming language that I have encountered so far is wrong. It is only different.

What is "really wrong with Java", not the language but part of the "culture", is a tendency for writing excessive code and xml, abstraction, mocking, etc. but overdoing things happens everywhere.

And a ridiculous "Ruby culture" thing was a DSL used for BDD called Cucumber. It promised tests that look like English so that analysts could write the tests, but then you had to write backing code so that would work. But a lot of people still use it.

And a ridiculous Javascript thing is Node. Javascript on the server? You have to be fucking kidding me. But now you can get a nice job in SF with JS experience.

Pointing these things out is useless. I make a lot of mistakes. Many publicly and online. People grasp onto "bad ideas", but really they are just ideas later proven to be not as good as some other idea. So, write your "everything that is wrong with Java" classes, SpringSource/VMWare/EMC employees. Nothing wrong with that.

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

#95
post #72

Earlier quoted context omitted.

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, O…

Sure. If you don't like OO and not found it to be productive, you don't have to use it. And you are more than welcomed to state OO doesn't work for you. However, blanket statement like Java sucks or OO fails (not directed at you) is not constructive criticism. It's just insecure programmers using other languages trying to justify their insecure language choice.

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

#96

The thing is, it's not Java's fault. You can write good Java code. It can be small, and easy, and nice. The problem is the word Enterprise and the abusive abstractions that seem to come along for the ride. Also, many of the abstractions start as good ideas, but they soon become a hammer and everything else becomes an AbstractNailFactoryInterfaceManagerProxy.

[deleted]

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

#97
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 actually really like Java logging (well, I like SLF4J and logback).

On Ruby, I'm constantly at a loss on how to do logging. Sure, in Rails there's the Rails logger available pretty much everywhere. But if I'm writing a reusable library, I can't count on that. So what do I do? Demand every user of my library configure it with a logger?

The stdlib Ruby logger also has no way to fine-tune log levels by class. In a Rails app, sometimes I want debug level, but I rarely care to see each and every SQL statement. (There tend to be hacks to monkey patch around the common cases suggesting others have been similarly frustrated.) Even if I use log4r or some other logger with more fine-grained tuning, within Rails, everything will be using the same logger object, so the typical Java method of tuning by giving each class its own logger doesn't work.

Bleh. Give me SLF4J with logback any day. When writing a reusable Java library, I really have no qualms about using SLF4J.

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

#98

No programming language that I have encountered so far is wrong. It is only different. What is "really wrong with Java", not the language but part of the "culture", is a tendency for writing excessive code and xml, abstraction, mocking, etc. but overdoing things happens everywhere. And a ridiculous "Ruby culture" thing was a DSL used for BDD called Cucumber. It promised tests that look like English so that analysts c…

Cucumber has some flaws in my opinion, but I think saying its intent was to allow non-developers to write tests is mistaken.

It's more a straightjacket that ensures a minimum of mutual intelligibility, particularly when a developer and domain expert are collaborating. Trying to make a tool that non developers can use to write tests is nearly pointless (selenium remote control for example). But adopting an approach where an analyst can look at what's on the screen and say "Hey, no, that's not right. We have to get the foo form in the file before it goes to bar department, not after." It's also nice in the context of CI, where non developers can look at a status webpage and see the state of an app is without drowning in technical details.

As an aside, my criticisms:

I hate how favors a specific BDD template (As A, In Order, Given, When, Then etc) rather than letting people pick their own language sensible for their project. The product/business people I've put in front of cucumber generally disklike that language, and often feel resentful for it being forced on them.

And secondly, I think the way statements are matched to step definitions via regex is awkward. Regexes in general tend toward frustrating abstraction. Do I want $1 or $2 or $3 or wtf was $7 supposed to be again? They also don't compose well. In my experience this choice ends up making the step definitions a cluttered dumping ground that takes more effort to organize than I'd like.

I think both of these would be solved by using a more proper grammar mechanism, probably PEGs, and keeping the rest of the tooling ignorant about its specific definitions.

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

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

"Improve it later because it's painless to do so?" I don't think so. Quick and dirty approach and then fix it later is just the start of future issues, broken designs, infinite refactoring. I feel java helps a bit more on design scalability. Yes, maybe somewhat overegineered but it certainly does not hurt to think on the future

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

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

I found the Java standard library to be very good. Why do you have to mock something if you don't agree to it? There's a reason to design and build things certain way. If you don't like it, don't use it. You are not the intended audience. What is this imaginative Java community that you are laughing?

Could it be all these mocking are symptom of your insecure language choice or library choice?

Post reply on HN