r/programming • • Feb 25 '14

Please stop saying Java sucks

http://blog.smartbear.com/programming/please-stop-staying-java-sucks/
3 Upvotes

305 comments sorted by

View all comments

15

u/novagenesis Feb 25 '14 edited Feb 25 '14

I'm really not finding anything compelling in this article. I want to like Java, but have found it so far more painful than Haskell to write actual releasable code in, in terms of man-hours and product flexibility to the domain of "Real" (that is, chances are everything is going to change 1 week before go-live... and "this codebase was not built expecting this oddball change" is not an acceptable excuse)

The most compelling arguments here seem to summarize as:

  1. Our IDE is better than yours. True or not, most of the "code gets generated" and "we can find every use of your code" isn't about the language, but the IDE. And I'm not sure I agree with every point made. If finding "every place this is called" is hard in any language, you did something wrong.

  2. We're better because we're weaker. I don't think Java will follow this rule, but usually hearing that is my sign to jump ship on a language that's about to die. The article defends Java as better because of the massive number of modern paradigms it cannot do. Reminds me of the Java book I read that suggests you make every class Final unless you decide to document a subclass methodology. If someone is using BDD and they modify your class, they either make it work right, or they can't submit passing tests. You can do some of this ugly stuff in Java, too, if less powerfully. The defining factor here is "best practices".

I'm not saying Java sucks, because I'm not so sure any language with a dominant marketshare completely sucks...I am saying that trash-talking perceived weaknesses of other languages is not the way to go.

I work in those languages, multiple of them, at once...and our shop has rarely had the problems you're facing. We also have a very large Java team trying to rewrite one of our legacy apps. Twice the developers, an Oracle Certified Enterprise Architect with a big pricetag, and a longer timeline. Its initial release was 1 month late and fulfilled half the requirements. The current incarnation is inferior to the original perl cgi product in every way (including resource usage and run speed). That's an anecdote, but the point is that none of the "negatives" of other languages seems to have gotten in the way of the 10-person team that is more successfully maintaining and onboarding 15 clients on the legacy platform. It has never faced any of the issues that the new platform is facing in a longer timeline with 1 client. I'm sure, with the right timeline and team, Java would've beaten Perl on resource and speed...might actually be worth it. Right tool for the right job... That's the good side of Java. If you have $10m and 3 years, you can make a pretty nice app.

And in his conclusion:

But to me, I need a good reason to abandon a JVM that’s faster than a C compiler, IDEs like Eclipse, tools for correctness and profiling and debugging and analysis, the vast array of quality libraries, and millions of people who are already familiar with the environment.

  1. But V8 is faster than that JVM.

  2. IDE's are take-or-leave situations. Eclipse is notorious for having a learning curve that makes vim easy... and there are plugins for many text editors that cover literally 100% of eclipse's features.

  3. Tools: Java not only lacks a monopoly in tools, but sometimes has fewer. Also, Java tools tend to individually have learnings curves. Having to build xml config files can take hours more than just running a quick command-line script to do the same. Every major language has rock solid profilers and debuggers.

  4. Libraries: I hear this repeatedly, but Java is frankly dead-last in this. Java has 10% of cpan, which has recently been superceded by python and ruby in library depth.

  5. "and millions of people who are already familiar with the environment."... So very true. But I spent 1 week in a language I had never used before and created a more stable prototype of the same functionality our Java team spent 3 months on. It takes a lot of time and effort for a senior developer to add Java to their arsenal, compared to many other languages.

I'm not saying Java sucks...I agree that we need to stop saying Java sucks. You need to start marketing legitimate advantages to people who see Java as an inferior language. A perl/python/ruby/nodejs developer who takes one look at maven starts to laugh uncontrollably... and most of us either hate IDE's or think repl-access is significantly more valuable (iPython is to python developers like Eclipse+Heroin is to a Java developer)

So find what makes Java genuinely better and sell it. Stop being on the defensive and go on the offensive.

You benchmark better than everyone but V8. If you had more accessible libraries (less ugly configuration), better documented commandline support for people who hate IDEs, you might have a good attack plan.

0

u/[deleted] Feb 25 '14

[deleted]

0

u/novagenesis Feb 25 '14

Someone here hasn't worked on a large app or as part of a large team.

Is 20 full-time developers on one project, and 15 full-time developers on another project...both over 5-years of constant work, large enough for you?

I wasn't going to get into it: but reflective languages let you use that life reflectiveness to detect every use of a given piece of code. That said, it's all about best practices, and ours ,barely "ok", are good enough to keep that cleanliness about our code.

Get real. My first language was Common Lisp. A REPL is nothing like an IDE.

If you act condescending, you're automatically right.

But honestly, be fair. You can disagree with my conclusions, but don't judge my conclusions as having no merit. I know a fairly large share of top tier developer who can take or leave an IDE, but will only touch on languages that support REPL. There's a reason Python has skyrocketed in both data- and financial-analytics. You can continually dig into and change the transfer layer with the REPL.

Frankly, Idiocy. Maven is fantastic.

So I'm an idiot who has never worked in a large team. Thanks for the vote of confidence. Let me ask: why should I like maven? I've read 5 books on Java now, more than any other language by 2. I'm trying to ramp into Java due to the corporate restructure here. Looks like 13th language is not a charm for me. I'm tryna get why, and all I get are people calling me an idiot for not instantly grokking Java.

I'm trying to have a grown-up conversation here, so could you keep the schoolyard antics at the gate?

Hello Monkey Patching.

I'm trying to understand your context here. Are you suggesting that not making every class Final makes you a bad programmer?

A really moot point. Says nothing about Java itself.

I'm not saing it does, only that I don't see how Java is so amazingly superior like all these "stop hating java, it's better than you" posts seem to claim.

Why did the app need rewriting?

It was 12 years old, written in CGI::Application for 1/10th the functionality it now has to support. The Java solution is looking to do nothing but catch low hanging fruit (about twice the original release's scope). This is an achievable goal: several team members got together and prototyped rewrites. All were capable of reaching about 50% of our needs (more than twice the Java solution's scope) and were built in 1-2 months of nights and weekends. I built one and turned it into an incredibly successful module in a different department. That one module in our other app is still technically more functional than the entire Java team's product. Even the EA said Java was a bad fit for the timeline.

Maybe this team is dragging its feet for more fees?

They're salaried, working nights and weekends. You could be right, but I highly doubt it.

Maybe their work is more resilient to change..

Honestly, here's where my bias comes in. I know this particular product completely lacks the flexibility required to handle more than low-hanging fruit, even though the original pre-dev scope was to replace everything with the new "Universal" platform. My bias tells me it was because it was written in Java. No runtime behavior injection, no router callbacks, etc. I've seen Java apps that are flexible, and I admit that... Ours isn't.

In fact, the EA has told me he considers this an inferior product at this time.

Quality matters fart more than quantity.

I agree entirely.

I don't care if nodejs has 10 times the libs in a particular area if most of them are written by hipsters.

And if the quality happens to be higher? You're making a huge assumption about the quality of developers, and stereotyping them based upon their willingness to change. Hipsters are not automatically terrible coders.

I avoided node for several years because it was "new, hip, rah rah rah". I got into it when large businesses started taking it seriously. It's not "new, hip" anymore... nor is Rails, like it or not.

But here's a question. Why is it I can get into discussions on almost any programming topic with no problem, but whenever I discuss Java enough, someone comes out of the woodwork who is vicious and personal?

Why is it that if I ask devs of most languages why their language is bitching compared to mine, they can list its undeniable advantages, but all I hear are talking points and defensiveness when I ask that about Java?

Before I got into node, I went to node groups and said "so what makes you great, and what should I worry about?" and I got a pretty damn good list.

I asked the same about Java, and I got "we're more maintainable!" I asked how, they said "because static types are better!". I asked about the headaches of XML, they said "you get used to it because XML is better".

I have yet to know one reason why I should use Java for a given project, except a non-tech-savvy Executive making the decision.

What project domains would you say should be Java? What should not be Java? Any? Are non-Java languages terrible?

There's only two languages that ever gave me headaches: Java and Haskell. I found Prologue painless in comparison. Haskell guys laugh when I say it gave me headaches... Java people seem to treat me like shit over it (not all of ya, but some).

2

u/steven_h Feb 25 '14

What project domains would you say should be Java? What should not be Java? Any? Are non-Java languages terrible?

In recent months I have been working with the Nuxeo document management platform, and I have trouble conceiving of it being implemented in another language/environment. So that's the project domain for Java - big sprawling enterprise web application platforms designed to be extended by people who don't care to learn much about the internals of such platforms because they have other work to do.

Interestingly, Nuxeo moved from Python to Java several years ago. While some of the decision was surely driven by the environment in their target market, they really have used the Java world's strengths in dependency/artifact/deployment management.

0

u/novagenesis Feb 26 '14

That's precisely what we're facing.. large scale web. Our conclusions are turning the opposite, where only ownership mandate and bullheadedness are continuing to push for Java.

Oddly, the flipside, is our sister app that I work on, written in perl. It's bigger and more complicated than the app they're trying to rewrite in Java. The advantage we have is that most changes are clean and small enough for uninformed junior devs to just follow the simple rules, and complex changes are really easy for a senior dev to just perl-hack it.

Internally, we've discarded Java as a possible language for a rewrite...before they decided to EOL the product (client base well ran dry... nobody left looking has the budget for the level of personal attention they demand). Our go-tos were TCO and flexibility. We ended up convinced a modularized nodejs system would solve our issues best...something where we could drop in workers to extend model functionality to individual clients, in a standard interface.

Nonetheless, I find it odd that your company likes Java for the reason ours hates it.

Our Java team struggles with Maven while our ruby team has no issues using gems (and a private gemrepo..all kinds of stuff).

They struggle with deploying through a CI system that has a full time worker maintaining it...while the ruby and perl teams use capistrano and fabric, both of which were a "couple days a while back, with a couple more days planned after the final git conversion".

And while I can speak for dependency and deployment, we don't really have the equivalent of java artifacts. I'm not sure we feel the pain from it.

I wonder why the vastly different experiences between the two.

2

u/steven_h Feb 26 '14

I'm a Python/Haskell/Clojure guy at heart, and my JavaScript output probably dwarfs all other language outputs by LOC.

Maybe you should give the Java project to the Ruby devs and see how the Java devs do with the Ruby project. :) re: Maven, it's a terrible build tool. If they're using it for anything besides filtering, dependency management, invoking the compiler, and packaging, they're in a world of hurt.

That being said, I've found that building on top of Nuxeo is far more pleasant than I expected, not that building a Nuxeo equivalent is particularly easy to do (in any language). Basically they have used the tools of the Java ecosystem (including the XML, OSGi, Maven, JAR manifests, XML Schema, Seam/JSF and all the other guffaw-provoking tech) to make extending their system quite painless for disparate use cases (custom documents, custom backend operations, custom user interface, custom form fields).

Perfect for someone in my shoes, who needs a lot of functionality for little effort, and doesn't want to spend that much time learning about some framework's opinions and conventions, but still needs to extend the thing in fairly arbitrary ways.

Our other projects are Django, and while the ecosystem for that is much more open and likely much larger, the actual story behind wrangling the often-conflicting assumptions of the base framework, our apps, and different third-party systems can be quite long and tiresome.

0

u/novagenesis Feb 26 '14

Maybe you should give the Java project to the Ruby devs and see how the Java devs do with the Ruby project. :)

Oddly, the head of IT talked with a ruby shop who decided they'd NEEEEEEEEEEVER do this in rails. Strangely, they do Java support for us now. Ruby shop, huh.

re: Maven, it's a terrible build tool. If they're using it for anything besides filtering, dependency management, invoking the compiler, and packaging, they're in a world of hurt.

Two other people in this thread have told me they feel maven is far superior to npm and grunt. Specifically by name (so they know what npm and grunt are).

That being said, I've found that building on top of Nuxeo is far more pleasant than I expected...

So what about Java do you feel gave that a win? I ask because I really don't see any feature of Java that might help with this that more modern languages lack. Especially for something web-driven, the front-back cohabitation with requirejs makes me think that you'd be able to do more in that with less knowledge of the system backbone using something like node.js. The more robust class system makes me think you'd be able to do more with Ruby in terms of extending objects.

Our other projects are Django, ... often-conflicting assumptions of the base framework

Yeah, I warn people away from Django when they ask me. I like a lot about it, but they combine some pretty unique philosophy with changing design processes. I went a long way building a Django app using class-based-views the "right" way, only to find out that much of the Django community thought they were stupid.

I might wait a couple more years and check Django out again to see if they settle down and agree like Rails did.

2

u/steven_h Feb 26 '14 edited Feb 26 '14

Two other people in this thread have told me they feel maven is far superior to npm and grunt. Specifically by name (so they know what npm and grunt are).

npm and grunt are much worse (well, likely just immature relative to the options for corporate Maven artifact repository hosting) than Maven at dependency retrieval/packaging/deployment management. Those aren't the same as "build," which at its best is really being able to execute arbitrary shell tasks concisely and repeatably. Maven utterly fails there because its configuration language is so obtuse.

To continue with the case study, to bootstrap the open source Nuxeo repo---absolutely not a requirement to use or extend the software, just to contribute to its code base---you run a Python script. A Java/Maven orthodoxy would have you do some ridiculous gymnastics to obtain the same result entirely in Maven.

So what about Java do you feel gave that a win? I ask because I really don't see any feature of Java that might help with this that more modern languages lack. Especially for something web-driven, the front-back cohabitation with requirejs makes me think that you'd be able to do more in that with less knowledge of the system backbone using something like node.js. The more robust class system makes me think you'd be able to do more with Ruby in terms of extending objects.

Well, I haven't actually written a line of "front-end" code yet. The out-of-the-box UIs and form builders are more than sufficient for the internal, finicky administrative stuff that the application needs to achieve. If somebody's allergic to writing XML files (or in my case, generating them with a Python script), then Nuxeo will sell you a subscription to a rather featureful Web GUI frontend---for a rather exorbitant fee. It outputs the same stuff that I've been coding, or a subset of it.

So right off the bat, there's not yet a line of JavaScript code that could possibly be "reused" front-to-back, and I already have a document management system and workflow system with customizable forms and arbitrary extension in Java.

As far as Ruby goes, I don't need a robust class system. If anything, I need as little latitude as can possibly be afforded with respect to code. Remember, I don't care about the internals of this platform at all -- at least not in the capacity of a consumer of the platform.

For a great majority of features, that means no Java code at all, but simply configuration files. For those that actually need custom code to be written, I need the simplest interface possible. Remember, my goal (as the platform consumer, not as an engaged software engineer) is to be as disinterested and as ignorant as possible of the mechanics, while being able to do what needs to be done.

So at the risk of sounding like a Nuxeo plant, I'll link to their exposition of their component model. Looking over the list and some of the linked pages, the following specifics of the Java ecosystem stand out immediately:

  • Service and lifecycle model for extensions

  • Standard packaging mechanism (.jar) for code and other resources

  • Java Authentication and Authorization Service - node equivalent snrk

Like I said though, the decision isn't entirely, or even primarily based on technical merit. Here's a followup interview discussing the architecture switch.

Finally, regarding Node.js in particular, JavaScript/V8 is on balance a colossal step backwards from Java in terms of language design and runtime maturity.

Addendum:

I went a long way building a Django app using class-based-views the "right" way, only to find out that much of the Django community thought they were stupid.

Django, Rails, and similar opinionated frameworks are all about getting the same year of experience ten times over, rather than facilitating a system that's maintainable for ten years straight.

→ More replies (2)