Live data from Hacker News

Stop hating Java

andrzejonsoftware.blogspot.com

51–60 of 158 posts

Re: Stop hating Java

#51
I've done a ton of Java work, server side and desktop apps. What really amuses me about Java advocates is how they don't realize that the XML is not there for "configuration", it's there to form a dynamic (non-statically typed) appendage to the language. The trick of Spring and similar tools is that under the covers they use the reflection API. It's sort of a joke to claim that you are using static typing, when the config files are more or less a contained bit of dynamic typing.

Re: Stop hating Java

#52

Earlier quoted context omitted.

Right, http://books.google.com/books?id=1MsETFPD3I0C&lpg=PP1&#3... It actually came from Smalltalk, just for a change.

Well, Unit Tests also came from it (SUnit was the first Unit Test framework). Which is unsurprising, as refactoring without unit tests is quite daunting. But JUnit did make them mainstream, and so did Eclipse' refactorings.

Interestingly, refactoring usually works quite well for functional Haskell code without tests just relying on the types. (Of course the types won't help you in more imperative sections of your code, i.e. it's hard to guarantee a specific order of actions in the IO Monad with types only.)

Re: Stop hating Java

#53

I think a lot of the Java hate is because of the architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF, FactoryFactoryFactory shit and so on. I remember seeing the earlier versions of the servlet API and it was very elegant and well designed; unfortunately once the astronauts were through with it writing Java web apps became such a form of mental torture (Struts, anyone?) that even…

... architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF ... Thank you for writing this. When I first read the GoF Design Pattern Book I thought "this is the reason, why the code in my project is bloated, unmaintainable and shitty".

I do think GoF has it's place, and every serious programmer should be familiar with it; if only to know what to avoid.

[edit] I didn't mean to sound so negative about GoF. Know the patterns so you know when to use them, and when to avoid them. You can't debate these decisions when you're ignorant of design principals and history.

Re: Stop hating Java

#54
post #45
post #29

Earlier quoted context omitted.

I work in what is essentially a Java shop and the opposite is true for me. The Java programmers work on the data set and provide me with an API. My responsibility is to present the data using a Rails application in a sound UI and in the fastest way possible. They often make remarks about how Rails is easy and Java programming is where real men make their mark. I think this comes down to a need for people to feel prou…

The opposite is true for me too. I've had an Enterprise Java guy telling me once that "programming and Object Orientation got lost with those simpler, easy-to-use language and frameworks", referring to Ruby and Rails. I dunno about that. Alan Kay would probably say that it got lost with C++ and Java, but YMMV. Also, one word: speed. But... I don't really think it boils down to this, it's not like one is better than t…

Why put "programming" and "object orientation" in the same sentence?

Re: Stop hating Java

#55
Long live the JVM and here we go again comparing Java to Rails the framework. I've seen the pros and cons of both Java and Ruby. From an organizational standpoint it's hard to beat Java. The performance is there and in a team setting statically typed languages really shine. You can argue about the quality of programmers that flock to Java quoting pg ad nauseaum but we don't live in a lisp world. Elegant code is written by good programmers not the language.

Ruby is fun and really nice for exploring ideas though. It doesn't marry you to an IDE and you can go from idea to reality quite fast with a text editor and a command line. Unfortunately, Rails is a lot of meta-programming magic and syntactic sugar that can really obscure the language for newbies. It's changed the landscape for web frameworks and I would even say mobile as well. RoR didn't invent MVC but it certainly refined our thinking of frameworks in general.

Re: Stop hating Java

#56

I think a lot of the Java hate is because of the architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF, FactoryFactoryFactory shit and so on. I remember seeing the earlier versions of the servlet API and it was very elegant and well designed; unfortunately once the astronauts were through with it writing Java web apps became such a form of mental torture (Struts, anyone?) that even…

I love the term "architecture astronauts", and you get them everywhere in this field, not just programmers.

I agree that it's not java the language (java's boring, but not unusable), it's the java culture from the last decade that drives people away.

Re: Stop hating Java

#57

I think a lot of the Java hate is because of the architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF, FactoryFactoryFactory shit and so on. I remember seeing the earlier versions of the servlet API and it was very elegant and well designed; unfortunately once the astronauts were through with it writing Java web apps became such a form of mental torture (Struts, anyone?) that even…

... architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF ... Thank you for writing this. When I first read the GoF Design Pattern Book I thought "this is the reason, why the code in my project is bloated, unmaintainable and shitty".

You are right. The GoF only promoted bloated code. Who in their right mind would use patterns like the Observer, the Adapter, or the Visitor?

Not sure if you know the history, but the authors of the book really only collected the patterns that they had seen around them in Smalltalk and C++ code. They wrote a catalog so we could all refer to the same name instead of using different names for the same concept. They identified the common problems that these patterns tried to solve and they also identified the trade-offs. Oh yes, they identified trade-offs!

Unfortunately, many developers thought that they had to put as many patterns as possible in their code, which was not the intent of the GoF. Ralph Johnson said that they received emails like "I have now used 15 patterns in my project, do you think we should use more?"

Andrzej mentions in his blog post that Java (and C++) lacks dynamic capabilities so this is why sometimes, you need these design patterns to make your code more easily extendable. Other patterns are good even with dynamic languages (observers...).

Re: Stop hating Java

#58

Java as a language is decent. It's boring. It is stagnant. I expect very little of it. Java EE is an atrocity and it is just an over-enginnered pile of garbage. Try play framework. I just finished a webapp in play and the whole experience has been awesome. IntelliJ + Play + MongoDB is AWESOME. I haven't messed with the Scala version, but I can imagine that Scala + Play is even more interesting. Either way, Java EE/EJ…

Play! Scala is really, really, really cool. The major downside--drink if you're expecting this one, folks--is the recompile time. Building an app is just so bleeping slow.

But writing it? Very nice, aside from the somewhat iffy SQL layer. (I'm not a huge ORM fan, and the process of actually writing SQL through Anorm can be problematic.)

Re: Stop hating Java

#59
post #10

This hardly starts to address the things people dislike about Java. Sure, it's a capable language - the JVM even more so. The thing is, it hasn't kept up with the pace of everything else. The JCP is clearly broken. The best thing for people would be to move on, not in anger but to explore as many languages as possible. Java could very well be the best thing for some BUT you can't really say until you go out and look.…

That's an important point. When Java came out it was a big step forward for a lot of people. Most of the scripting languages with OO features (Ruby, Python, PHP) have a lot of Java influence. I see the problem is that Java stopped evolving a decade ago. C# shows the kind of path that a Java-like language can follow to get better, and Java just hasn't been moving.

Scratch Ruby and Python from your list and I'll agree with you on the OO influence! Not to mention Python is older than Java. I think most of the 'scripting languages' with OO have decidedly not gone the Java/C++ way.

Other than that I'm pretty much in agreement. Even not so long ago as 2002 people would say "Let's use Java" when they really were saying "Let's NOT use C++." C# is a great language, though MS didn't put their heart into really killing Java. I think Microsoft could have dominated with C# outside of Windows World (lots of enterprises still rely on Linux, and Java's not a bad choice for an enterprise app on a Linux server, then there's Android..) if they put more backing behind Mono or just open sourced everything to begin with.

Re: Stop hating Java

#60

Earlier quoted context omitted.

... architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF ... Thank you for writing this. When I first read the GoF Design Pattern Book I thought "this is the reason, why the code in my project is bloated, unmaintainable and shitty".

You are right. The GoF only promoted bloated code. Who in their right mind would use patterns like the Observer, the Adapter, or the Visitor? Not sure if you know the history, but the authors of the book really only collected the patterns that they had seen around them in Smalltalk and C++ code. They wrote a catalog so we could all refer to the same name instead of using different names for the same concept. They ide…

Exactly. What many GoF critics seem not to understand is that Design Patterns is descriptive, not prescriptive. It's "what we've seen," not "what you should use."
Post reply on HN