TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Stop hating Java

115 点作者 snatcher将近 14 年前

32 条评论

zeemonkee将近 14 年前
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 PHP was a welcome relief, let alone Rails. My hate for it came from having to use some shitty app server like WebSphere because the coding-averse CTO considered it a "standard".<p>Looking at more recent work such as the lovely Play framework and the influence of new JVM languages such as Clojure and Scala, it looks like things are improving in Java-land. It's still a bit dated and clunky compared to Ruby and Python (let alone Clojure/Scala or even Groovy) but it's not as bad as people make out.
评论 #2794242 未加载
评论 #2793567 未加载
评论 #2793623 未加载
评论 #2794453 未加载
评论 #2794191 未加载
mechanical_fish将近 14 年前
First, let me point out that once again we are comparing Java - a runtime, a language platform and an entire ecosystem comprising many frameworks - with Rails, a specific web framework designed with a specific philosophy (opinionated defaults that work in 90% of cases, YAGNI, etc.) for a specific range of uses ("rapidly prototyping a small-to-moderately sized web site").<p>So just because Rails developers hate something doesn't mean it's generally evil. It might just be wrong for Rails. Many things are; otherwise Rails would have no texture. Saying no to things is what design is about.<p>Now let's talk about hate. Everyone hates something. There is nothing wrong with hating things. Hate is just personal taste turned up to eleven. You should strive to hate politely and with grace, to realize that other people love the things you hate and are nonetheless human, and probably even smart. And you should strive to remember that there's an important difference between the things you hate and things that objectively suck. Java, for example, does not suck. Not always. Lots of work has gone into it. Lots of Java-based tools are essential. There are big classes of problem for which Java is currently the best solution.<p>Nonetheless, I hate Java. It is a handy mental shortcut, one that has yet to lead me astray. My belief is that the problems for which Java-the-language is the solution are problems I don't want to work on, and that I don't have enough time in my life to address the problems I <i>do</i> want to work on, so I should simply develop a Java allergy that kicks in whenever I see the generics syntax and that causes my eyes to water until I flee towards fresh air. It works well.<p>(What's sad is when you find yourself hating something that <i>is</i> smack-dab in the middle of a set of problems that you want to work on. Hello, PHP! This requires a much richer set of coping techniques than simple allergic avoidance.)<p>(And, of course, Java is not just a language, and JRuby appears, from the outside, to be awesome, and my curiosity about Clojure is rising, so I may soon temper my simple hatred of Java into a rich melange of love and hate. The stuff of which novels are born, really.)
评论 #2794086 未加载
评论 #2795512 未加载
yock将近 14 年前
All you need to do to experience this first hand is go to one Ruby meetup. The roundtable introductions at my local Ruby brigade are often seasoned with AA-like declarations of soberness such as "Hi, I'm So-and-so and I've been Java-free since 2006." As a Java pro (and someone who really does like Java) it's a little disheartening. On one hand I know they don't really mean to belittle the technology that pays my bills and feeds my family, but there's a definite mindset of superiority among some professional Ruby-ist communities.
评论 #2793358 未加载
评论 #2793426 未加载
评论 #2793471 未加载
评论 #2793712 未加载
sambeau将近 14 年前
<p><pre><code> "Refactoring came to us from Java" </code></pre> Maybe the word came from the Java community but people have been carefully restructuring code since code was invented.
评论 #2793391 未加载
评论 #2793314 未加载
dpark将近 14 年前
We seem to have a rather short institutional memory. It wasn't that long ago (Java's only as old as Ruby) that Java was new and hailed as a savior from C++ and C. Java was widely seen as a great language, or at least a language that presented a great improvement over the existing mainstream languages. It gave GC to the masses for the first time. It delivered standard-sized primitives, an (almost) everything's-an-object design, a cross-platform runtime, JIT compilation, and a host of other improvements to mainstream programmers for the first time. Java has a lot of issues, but in the grand scheme of things, it's a pretty good language.<p>Stroustrup was dead on: "There are only two kinds of languages: the ones people complain about and the ones nobody uses." The more popular a language is, the more people will complain about it. (And the more people will build crappy software around it.)
评论 #2795048 未加载
16s将近 14 年前
It's been my experience that most people who put down Java or C++ or [your language here] have never seriously used the language and are insecure about learning a new language so they make fun of other languages to hide their insecurity.<p>Edit: I'll also add that this is not limited to the Ruby community.<p>One last edit: General Patton once said, "Find what a man is cynical about, and you will know his weaknesses." or something like that. I think that quote applies here.
评论 #2793671 未加载
评论 #2793528 未加载
评论 #2794271 未加载
评论 #2793455 未加载
评论 #2793371 未加载
评论 #2793364 未加载
yesimahuman将近 14 年前
Java is awesome purely because of the large corpus of useful libraries. Apache, stanford NLP, etc. Universities and open source groups contribute a large amount of Java code and it really pushes the boundaries of the types of applications you can create that are mature and perform well.<p>Other than that I develop much faster in Python or Javascript. I've come to love treating functions as first class objects, and I just don't love static typing that much anymore.<p>Getting my projects done more quickly has become more important than anything else. It just so happens that other languages than Java are better for that.
评论 #2793636 未加载
评论 #2793501 未加载
programminggeek将近 14 年前
Java as a language is decent. It's boring. It is stagnant. I expect very little of it.<p>Java EE is an atrocity and it is just an over-enginnered pile of garbage.<p>Try play framework. I just finished a webapp in play and the whole experience has been awesome. IntelliJ + Play + MongoDB is AWESOME.<p>I haven't messed with the Scala version, but I can imagine that Scala + Play is even more interesting. Either way, Java EE/EJB/XMLHell is probably my most people hate Java. Also, Swing was garbage too, but who builds desktop apps in Java anymore anyway?
评论 #2793698 未加载
评论 #2793625 未加载
jjm将近 14 年前
I believe there is hate because a lot of 'over engineering' was done in most projects. This then necessitated the need for more complicated (and `sometimes` useless) new Java techniques.<p>This most likely comes from seeing Java (or x,y,z) as thee only tool one would possibly need. Unfortunately, Java much like every other lang should be seen as a tool with pros and cons, in a chest of other tools.<p>Also, it's bad measure to only consider deployment size regarding any platform effectiveness.<p>" Let's learn more from Java". I'd rather learn more from "Computer Science" and apply those techniques to Java. Not the other way around.
评论 #2793485 未加载
评论 #2793359 未加载
mattmcknight将近 14 年前
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.
评论 #2793780 未加载
评论 #2794368 未加载
snorkel将近 14 年前
Two other reasons I avoid Java the dependencies ecosystem for a typical Java app is bloated and always changing, and it didn't really live up to the promise of write-once-run-anywhere. And by the way, the over-abstraction habit is really annoying when you're trying to write a simple util app and you can't just say foo = new Foo() instead you have to extra nonsense such as factory = new FooParamsFactory() then fooparams = factory.getFooParams() then then foo = new Foo(fooparams) ... it's nice to get away from that nonsense. I just find Java to the playpen of architecture astronauts who would rather design APIs than write apps.
评论 #2793569 未加载
Troll_Whisperer将近 14 年前
I may be the target of this article. I like Ruby quite a bit and I don't like Java at all. The word "hate" isn't quite appropriate, but here's my problem with Java:<p>I hate how much work Java makes me do to get things done.<p>It doesn't matter if you're writing "hello world", an English to pig-latin converter, a web server or a lisp interpreter. In every case, it's a lot less code and a lot less work to do in Ruby than it is in Java. Java is just too low-level of a language for anything I'm working on, and in those cases where I <i>do</i> need to get closer to the metal, it's easy enough just to use C.
flocial将近 14 年前
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.<p>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.
评论 #2793770 未加载
chrisledet将近 14 年前
I don't hate Java. I just prefer to write code in Ruby.
a5seo将近 14 年前
Another reason to stop hating on Java is that in a lot of cities, it would be a fool's errand to assemble another kind of dev team. Like Ruby? Great. Good luck building a team in Omaha.<p>Skills go where the jobs are: <a href="http://www.indeed.com/jobs?q=ruby&#38;l=Omaha%2C+NE" rel="nofollow">http://www.indeed.com/jobs?q=ruby&#38;l=Omaha%2C+NE</a> = 11 jobs <a href="http://www.indeed.com/jobs?q=j2ee&#38;l=Omaha%2C+NE" rel="nofollow">http://www.indeed.com/jobs?q=j2ee&#38;l=Omaha%2C+NE</a> = 101 jobs<p>Bottom line: if you expect to hire developers, in most places, you'll want a language with the deepest bench of talent. The trick is to resist the Java framework nazi's and keep it simple.
评论 #2793927 未加载
评论 #2794334 未加载
podperson将近 14 年前
No. I prefer to continue hating Java.<p>Having recently decided to abandon my anti-Java prejudice from way back I've discovered that everything I hated about Java back in the 90s is still there, only worse.<p>COBOL at least had the excuse that it was first.
Fid将近 14 年前
Job search in New York City on Dice.com: Java - 2698 Ruby - 204<p>Even within the Ruby jobs, the majority have a Java requirement within them as well.<p>Been hearing Ruby aficionados for like a decade, but sorry, it just hasn't penetrated.
评论 #2794290 未加载
strmpnk将近 14 年前
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.<p>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. From where I'm standing (subjective since I left Java ages ago) most people that go out to explore new things rarely go back.
评论 #2793463 未加载
perlgeek将近 14 年前
I don't hate Java, I just don't want to use it.<p>I find it ridiculously verbose, and the lack of closures (or even passing around code references) leads to the perceived overengineering mentioned in the post (I'm not sure it's really overengineering all the time - it's just that a rather rigid language forces you to write huge amounts of code to make your library flexible).<p>That said I have no problem with using programs written in Java - in that case somebody else has already dealt with the things I don't like about Java.
评论 #2793480 未加载
beermann将近 14 年前
What's the general consensus in the HN community regarding GWT? We're pretty happy with it and I think it has a lot of advantages over other frameworks.
评论 #2794420 未加载
评论 #2794562 未加载
jbooth将近 14 年前
“If you drop static methods, then welcome to Java and its billions of useless factories.”<p>And if you use them everywhere, then welcome to Rails, where to service more than 1 request at a time you actually have to run multiple instances of the whole app behind a balancer.
fleitz将近 14 年前
Ruby and Java serve different developer segments, it's much more fun to compare Java and C#. Java and C# are languages that are pretty much the same, serve similar markets but one of which I vastly prefer to program in because of the little niceties: no checked exceptions, first class functions, closures, properties, etc.<p>Comparing Java to Ruby is a philosophical matter, comparing Java to C# illustrates numerous ways in which the language and runtime (real support for generics) could improve while staying true to its market.<p>The article honestly looks like a comparison between rails and java rather than ruby and java.
its2010already将近 14 年前
I have a question...<p>The article states:<p>... Whenever you needed a pluggable system in your code you had to abstract away some concepts in order to make it work. Ruby lets us do it much easier and that’s cool. ...<p>Can someone give a concrete example of this?
juliano_q将近 14 年前
Java had many problems with absurd over-engineering (aka EJB2) in the past. Even today, a LOT of legacy code is over-engineered and a pain to mantain.<p>That said, it is possible to write thin apps with Java today, much by the innovations brought by SpringSource. Roo is a rails-like framework to Java that works really well, and the Spring container took out the word EJB from almost every new project.<p>If I have to choose a language to start a new project today I will probably go with other language, but I have no problems working with Java at all.
评论 #2793694 未加载
mark_l_watson将近 14 年前
I am not in the mood to defend Java, but I would like to give a tip to people who keep mentioning J2EE: J2EE is from a bygone era; learn to say Java EE 6, which is better (although JPA 2 is really the only part I like) and take J2EE out of your vocabularies. Discussing J2EE kind-of makes it sound like your knowledge is out of date.<p>Also, Scala and Clojure are wonderful languages so I don't understand some of the negative comments about them.
jinushaun将近 14 年前
C# is a better Java anyway.
评论 #2793328 未加载
评论 #2793420 未加载
swah将近 14 年前
The part that I don't like is when I can't write a webapp in Java because I don't know about Hibernate and JBoss and Maven and servlets and JDBC and more. I'd love to try a strict language, having used only Clojure and Python lately. Playframework might be an alternative.
评论 #2793658 未加载
评论 #2794566 未加载
kungfooguru将近 14 年前
Didn't all those "good" things he mentions that come from Java actually come from other languages (Smalltalk, Haskell, Lisp, ...)?
dillon将近 14 年前
I believe the fact that Oracle owns Java is almost reason enough to hate the language.
23r90q3aefij将近 14 年前
dammit its a tool, whats the big fuss about. People can act so juvenile some times.
评论 #2796464 未加载
funkah将近 14 年前
&#62; "I always disliked the XML impact on the Java frameworks. It didn’t come from nowhere, though, let’s be fair. Java as a languages is not as readable as Ruby, so it wasn’t perfect for configuration. Yaml wasn’t popular and JSON was still not really mature back in 2000. Something had to be chosen and that was XML. What would you do better back then?"<p>This piece seems to be mistaking criticism of technology with criticism of people, which is what happens when nerds get too personally attached to languages, frameworks, OSs, etc. I don't think Java folks are stupid for using XML, or anything of the sort. The above succinctly lays out the reasons why that choice made sense at the time, but times change, and that is not a reflection on the judgment of those who made this decision.
benihana将近 14 年前
What I don't understand is, why does this guy care if other people don't like the language he likes? It doesn't change the number of Java jobs or the kind of things you can do with the JVM, so why does he care if a bunch of Rubyists hate Java? Also if he doesn't want people to hate his language, maybe he should use something other than Java.
评论 #2793423 未加载
评论 #2793338 未加载
评论 #2793365 未加载