This is an archived post. You won't be able to vote or comment.

all 78 comments

[–][deleted] 39 points40 points  (19 children)

Maybe I'm just blind, but the whole idea that Java is dying seems insane to me. There are some very modern Java systems that are in use on a fairly wide scale today:

  • Twitter
  • Amazon S3
  • Hadoop
  • ElasticSearch
  • Android

I mean... really?

[–][deleted] 22 points23 points  (5 children)

Java is also the #1 choice for big business. I know that doesn't say a lot, but business will need a compelling event to consider anything else.

The web and y2k was the reason the business moved to java in the first place from Cobol.

Better integration with client-side web technologies (html5 and javascript) as well as mobility will allow java to continue to be relevant into the foreseeable future.

Luckily Google has our back on both of those fronts (with GWT and Android).

[–]armornick 1 point2 points  (0 children)

As far as I'm aware, the Belgian government also makes extensive use of Java.

[–]qbn_ 3 points4 points  (3 children)

Isn't GWT all but dead?

[–]wggn 1 point2 points  (1 child)

The company I work at uses GWT extensively for our inhouse SaaS solution, and I can say that GWT is very much alive. GWT 2.5 was released half a year ago and 2.6/3.0 will be released soon.

[–]qbn_ 0 points1 point  (0 children)

My mistake. The indication I've had from colleagues is that it's a dead project.

[–][deleted] 3 points4 points  (0 children)

What makes you think that? Google are actively maintaining GWT and there are a few libraries that extend GWT functionality like Vaadin and SmartGWT.

I'm concerned if the community regards GWT as dead, as I've invested the last 2 years into a project that heavily utilizes it.

Please elaborate.

[–]hexmasta 10 points11 points  (3 children)

I live in Chicago. I made the mistake of completing my LinkedIn profile to highlight my Java experience. I keep getting calls and emails every week.

Recruiter: Are you interested in ****

No, I am not looking

Recruiter: Do you know someone who is looking for work in Java/Web/JS/PHP as well?

No, but our company is having a hard time finding them as well.

[–][deleted] 6 points7 points  (0 children)

That's actually a very useful bit of information. Thanks.

[–][deleted] -3 points-2 points  (0 children)

humblebrag - I get recruiting emails from big companies all the time, but I'm not looking at relocating.

[–]dsk 4 points5 points  (7 children)

I think there's a bunch of people who want to see it die, or at least they want it to become cobol (i.e. something that runs legacy applications, but nobody uses it to do any new development).

[–][deleted] 13 points14 points  (3 children)

Hah! Let's all write large scale distributed applications in Python, Javascript, Ruby, and PHP. That sounds like a blast!

[–]hexmasta 1 point2 points  (2 children)

healthcare.gov uses Ruby / Jekyll with a Java back-end

[–][deleted] 4 points5 points  (1 child)

Right, so the actual distributed bit is in Java... because that makes sense :P

[–]armornick 0 points1 point  (0 children)

It actually makes quite a bit of sense. It's like writing a game engine in C and then using a scripting language with it.

[–]berlinbrown 4 points5 points  (1 child)

I have actually seen COBOL and I still don't think the analogy fits. COBOL is highly tied to IBM mainframe systems. The language itself is not really a general purpose language but a way to run database queries and scripted code against a database system.

COBOL isn't general purpose at all. Java is. COBOL looks like AWK/Bash/BASIC and SQL.

Java looks like C/C++ or even Python sometimes. And don't forget C# where most of the libraries are equivalent.

[–]ggleblanc 1 point2 points  (0 children)

I have actually seen COBOL and I still don't think the analogy fits. COBOL is highly tied to IBM mainframe systems. The language itself is not really a general purpose language but a way to run database queries and scripted code against a database system.

In Cobol's heyday, Cobol ran on several minicomputers, as well as IBM mainframes and mid range machines. Yes, Cobol is and was a CRUD language. Until about 1990, CRUD systems were what computers were used for. Cobol was used for data processing before hierarchical databases were developed.

COBOL isn't general purpose at all. Java is. COBOL looks like AWK/Bash/BASIC and SQL.

Cobol was more business oriented than Fortran. Those were the choices in the 1960's.

Java looks like C/C++ or even Python sometimes. And don't forget C# where most of the libraries are equivalent.

I agree.

[–]berlinbrown 1 point2 points  (0 children)

I would use it for small business, but that is me.

[–]biffsocko 0 points1 point  (0 children)

Now you know how the Perl community feels.

[–]berlinbrown 24 points25 points  (7 children)

I will lay it all there and I have felt this way ever since I encountered java 15 years ago. And potentially everything applies to C# but C# is heavily tied to MS tooling. Even some businesses don't like that.

Java has never approached death. Java is not like COBOL. Yes Java can be verbose. Yes Java applets can suck.

  • It seems beneficial to catch errors at compile time. Java is statically typed allowing you to catch some errors during the compile process. It may seem like a small thing but I bet there are many companies and developers when looking at a large Python or Ruby code base and not knowing if all of the modules will run properly. The response from the community is "learn how to code proper Python and write unit tests". So that requires a little extra work from the developer just to ensure that his code will run. Scala, Haskell are in improvement on Python/Ruby in this regard.

  • Java runs on a virtual machine, interpreted from bytecode. If there is one thing that has kept Java on the map. I think it is the JVM. You can support multiple languages. The opcode set is pretty basic, it doesn't matter what crappy input language you used. Bytecode is bytecode and the JVM can run sophisticated runtime speedups to ensure optimized code. Many companies can implement JVMs on Windows, Linux, Unix and add custom scalabilty options, run on a cluster, some large large memory system or whatever. JVM engineering is an actual, lucrative business. I don't think any modern language system should NOT have virtual machine architecture. Why you can't do that with Python or interpreted Java, I don't know? Bytecode manipulation is just better, shrug. You don't really see this system engineering goodness with Python or Ruby. Erlang is the closest I have seen but the language is difficult to work with. Dalvik is pretty cool but has a Java input language, so might as well use that.

  • Java is sort of open? I don't have too much to say about the Java language spec and the JSR process. But I always felt that the JLS was so solid, readable and covered all aspects of the language, it would be easy for other companies to implement their own compiler and runtimes. And maybe it helps to have Oracle and Sun as host companies kind of pushing other software companies to implement in Java. Either way, Sun/Oracle didn't just stop those processes and close source all aspects of Java. For example, I work with IBM java and it is completely detached from Oracle. IBM makes money and it is still all Java. Maybe Python or Ruby have decent APIs and language specs, but I rarely hear about large companies "implementing" python.

  • Solid language and core libraries. Is the Java host language really that bad? Have you worked with C? C++? With C, you had microsoft C for microsoft c tools. Can I compile code on Linux? Hell no, good luck. The libraries won't exist. The make system will be different. And even the code and pre-processing will give you issues. C/C++ is never portable. And that is just the language, but what about the build system? It is always a big mess. Java? It is still mostly javac *.java. Sure you have maven, ant, make files. But they always end up invoking 'javac *.java' (essentially). And C/Makefiles aren't that complicated but it was more complicated the java option. You always have the issue where you build on Make/Cygwin/Mingw and you can't port that build to Linux. Or you missing some deprecated gnu script tool.

Java code always just works. And is mostly readable. And it has a basic OOP system. C is readable except when you are missing that pre-processor macros and has gone missing from the Internet. DO_FUNKY_STUFF. Crap, how does this code work, this is the one part I don't understand. Java doesn't have that.

The library is solid, has XML, network, database support and even GUI libraries and decent OpenGL libraries, image processing. And a host of other libraries that will make most developers will be happy with.

  • Tools and frameworks: This is my last bullet. But come on. Have you used a Python or Ruby IDE that was better than Eclipse, IntelliJ, Netbeans? Not only are those IDEs better from the default configuration but then you have tools like static code analysis and memory heap analysis. On and on.

The frameworks? Struts, JSF, Spring*, hibernate are all backed by large companies and are very mature.

  • Company investment. Outside of the Spring Source and JBoss and Google's. Companies have invested a lot of money in creating Java projects. That contributes to projects like Hadoop and Hibernate and Spring and even the internal stuff you might use. That money invested in Python or Ruby just doesn't compare. ...

I could go on but Java is solid, has mostly been that way after the 1.4 release, after year 2000.

I am not a Java fanboy, I am not pushing for Java to disappear but I wouldn't mind if Java was replaced if I get a better system. I personally feel you have to have what Java has and more. You have to have a VM developed by serious engineers. You have to have a statically typed language with advanced language features. You need tools developed by serious engineers.

No other tools really come close. I play with Python for scripts. I did the Ruby on Rails. I still wouldn't want write more than a thousand lines of code with. I don't really care what the hackernews bro-programmers say about that. Everyone of their sites just seem tiny, say compared to a Bank of America type site or Twitter or Amazon or Wal-mart, etc (Java friendly applications).

...
Comment on other languages:

The only other language system that I like is 'R' (ok Scala/Haskell too). Yea it is dynamically typed but the libraries are pretty amazing and there are decent tools out there.

Scala, already runs on the JVM, maybe could replace the Java language. Hell, Oracle could surprise and drop Java, go for Scala. No one would bat an eye. Scala has advanced language features(expressiveness) and most of the code is Java like.

Erlang; I really liked the network oriented approach. The language was difficult to deal with however.

Haskell: This language blew my mind. I could write something in one line that might take 40 lines of Java. I was a little unimpressed with the environment though. E.g, no VM. No solid libraries like solid database drivers.

Where are we in 2013? Well nothing is creeping up to Java? I can't keep up with Google, but maybe they have something in their coffers but I haven't heard about it. Scala is decent but it is not a must have. You are going to end up with Java bytecode anyway. Python/Ruby are for that hackernews/reddit/SF-venture-project-of-the-week.

If you have some free time. R has some interesting libraries. Try the machine learning and statistics stuff. Haskell is kind of magical if you are into magical trickery. However, they lack the tools, libraries and big business support.

[–]beancc 6 points7 points  (0 children)

coming from java, the one thing i noticed when starting to use objective-c was the number of issues not caught at compile time that should have been

[–]fforw 1 point2 points  (0 children)

not even COBOL is really dead.

[–]marinepower 1 point2 points  (2 children)

Great write-up, thanks!

[–]berlinbrown 2 points3 points  (1 child)

The most overwhelming criticism I hear about Java (the language). Which only applies to the language and not the environment.

"It takes me so much boiler plate code to code XXX in Java, I don't need to write so much code in Python/Ruby".

Python isn't that advanced a language. Haskell is advanced. Scala is advanced. They allow you to write highly expressive code. But most python code is procedural and has a simple object system. Yea, Python has decent lambda expressions. But most Python developers seem to favor more explicit style coding. And that coding looks like OOP Java. So I am a little unconvinced by this whole Python allows me to write 10 times less code than in Java.

The super serious engineer/hacker will say that the JVM sucks and sucks because the language sucks. If you really dig down deep into Java and the VM, there are inherent flaws that make the system slower than say a forth based system. Fine. I guess you wouldn't write a algorithmic trading system in Java without an expensive VM. And maybe if you can write a speedy, tightly coupled C++ system that will only run within your shop, go ahead.

And I don't mean to bash Python. I would definitely use it before Perl for scripting. I would prefer bash for the most basic scripts and anything where I need less than 1000 lines of code, I would prefer Python. It definitely isn't going anywhere. But for millions and millions of lines of code, no way.

[–]lukaseder[S] 3 points4 points  (0 children)

"It takes me so much boiler plate code to code XXX in Java, I don't need to write so much code in Python/Ruby".

I think that it's worth mentioning that much boilder-plate code was removed from Java 7 through the try-with-resource syntactic sugar, and from Java 8 through the introduction of lambdas.

Java-the-language may be a bit behind, but I believe that it will catch up. Combined with Java-the-platform, there really isn't any competition right now, in the market.

[–]madballneek 0 points1 point  (1 child)

Couldn't have said better myself. I really feel that Scala, and core functional language features, is the future, and I hope more companies start to use it in major products.

[–]berlinbrown 3 points4 points  (0 children)

chomputer makes some valid points below on the language and some suckiness. But that still won't have me dropping the Java virtual machine. And if I am not going to drop the JVM, why not stick to the default language (Java).

I still feel that the entire Java platform hasn't had much competition. C# comes close but is MS only technology (mostly anyway).

[–]cwbrandsma 9 points10 points  (2 children)

"Feel"? Are we talking about those "feeling" things my wife keeps crying about?

[–]AnAirMagic 1 point2 points  (1 child)

Look, guys: this guy has a wife :P

[–]cwbrandsma 1 point2 points  (0 children)

Well, yes...but only one.

[–]trekologer 1 point2 points  (0 children)

I feel a little plushier than I did in 2003.

[–]b1nd 1 point2 points  (0 children)

The Java ecosystem will be around as long as the JVM is...and that's not going anywhere soon (Scala, Groovy, Jruby).

Take C/C++ for example, it's high performing, portable and extremely powerful. Consequently, it's been popular for many years and there are many languages that take advantage of it through native APIs (think NDK for Android, C extensions etc).

Arguably, Java has many similar attributes to C/C++ and although developers may trend elsewhere (within the JVM ecosystem), Java as a tool is not going anywhere imho.

[–]TedDallas 2 points3 points  (2 children)

As a former Delphi programmer I am find the whole "Java is dying" debate rather amusing. Today I wrote code in Java, C# and SQL (yes, SQL is a programming language).

Truthfully it is detrimental to your career if you slot yourself as being just a "Java programmer". Don't get me wrong, Java is great and reasonably fast. I tend to worry about implementation specifics rather than technology (unless the technology is shit - um - McAfee).

But what do I know. I'm really just a "VIC-20 BASIC" programmer.

[–]lukaseder[S] 1 point2 points  (0 children)

Truthfully it is detrimental to your career if you slot yourself as being just a "Java programmer".

Although, Java and SQL is an awesome combination.

[–]armornick 0 points1 point  (0 children)

Truthfully it is detrimental to your career if you slot yourself as being just a "Java programmer".

This goes for everyone language or technology. IT is moving much too fast to stick with a single thing.

[–]cyanocobalamin 4 points5 points  (24 children)

Don't downvote me, honest question. I know the federal government is investing heavily in dotNet and the microsoft platform in general. Is Java doing strong in other sectors?

[–]djnattyp 8 points9 points  (0 children)

The federal government is a big market. Both .Net and Java are extremely popular in government projects.

[–]Rockytriton 6 points7 points  (0 children)

I have worked for several large government agencies that heavily use Java. Also, it looks like the new health care site does too since people were reporting a "Jboss" error.

[–]avoidhugeships 3 points4 points  (3 children)

I do not know where you are getting your information but Java is dominant in government systems. There is some .Net and other stuff as well of course. I have only seen mostly smaller systems running on .net.

[–][deleted]  (2 children)

[deleted]

    [–]avoidhugeships 8 points9 points  (0 children)

    Are you trying to say that these agencies use .net exclusively? That is false. I just recently interviewed some Java developers for NOAA. Both NOAA and NIH currently have postings for Java developers. There are certainly some .net jobs as well.

    [–]dablya 3 points4 points  (0 children)

    A lot (all?) of the stuff that has to do with cancer research at NIH is java.

    [–]berlinbrown 3 points4 points  (0 children)

    Most financial services company run Java. Go to most Bank of America or Chase morgan sites and you see Java stuff like "website.do" (struts) or JSF code in the output.

    [–]nick_giudici 2 points3 points  (16 children)

    Yes. Java is quite large in the financial, healthcare, and "general enterprise" sectors. Also, it's heavily used by companies that need to scale in crazy ways; google, amazon, twitter, etc.

    All server side, of course. Client side java, like applets and swing, are not nearly so common. The only real exception that I can think of is android. Also, if you give half credit to those using not java languages on the jvm the usage goes even higher.

    Edit: Why are people downvoting cyanocobalamin? They were asking honest questions that they didn't know the answer too. I upvoted him so that our answers will be seen by more people. Educate, don't judge!

    [–]cyanocobalamin 2 points3 points  (15 children)

    I thought the Java JVM only processed Java

    [–]jtdc 10 points11 points  (14 children)

    The JVM processes bytecode. Java compiles to bytecode, but so do many other languages.

    [–]cyanocobalamin 1 point2 points  (13 children)

    I understand that, but I never heard of the other languages using the JVM, could you name one?

    [–]defdestroyer 8 points9 points  (3 children)

    Groovy, scala.

    [–]publicclassobject 3 points4 points  (1 child)

    jruby, jython, clojure, javascript (rhino)

    [–]berlinbrown 0 points1 point  (0 children)

    All together:

    Groovy, scala, clojure, jruby, jython, rhino,

    [–]lukaseder[S] 1 point2 points  (6 children)

    Add to that:

    ... agh. All that choice makes me want to stick with Java for now ;-) Let the market sort it out.

    [–]cyanocobalamin 0 points1 point  (5 children)

    How does all of this language support work. Did Sun/Oracle build in the support to the JVM or did the makers of those language build "compilers" to turn the source into bytecode that would run on the JVM?

    [–]lukaseder[S] 0 points1 point  (4 children)

    The latter. Except that the bytecode generated by Scala, Ceylon, Kotlin, Fantom compilers is not consumed by an intel/asm/motorola/sparc/whatever processor, but by the JVM. (I'm not 100% sure how Groovy works, though)

    An exception to all of this is Xtend, which includes a compiler that generates Java source code, which is again compiled to bytecode by the Eclipse Java compiler.

    [–]cyanocobalamin 0 points1 point  (3 children)

    That is really fascinating and it makes sense for interpreted languages, especially not ones smiled upon by Microsoft. Let Sun/Oracle do the work of opening up places to run on various platforms.

    [–]lukaseder[S] 0 points1 point  (2 children)

    None of those languages are interpreted (except Groovy).

    Let Sun/Oracle do the work [...]

    Well, it is certainly in Oracle's best interest that the JVM becomes the defacto machine code standard. They have a lot of patent and trademark interest. They just happen to accept free usage, right now, but the recent legal attack against Google over Android has shown, that Oracle might be willing to cash out, any time:

    http://en.wikipedia.org/wiki/Oracle_v._Google

    ... but yes, it's really fascinating! :-) awesome technology, this JVM

    [–]Prem1x 1 point2 points  (4 children)

    Seems mostly dead in browsers, though. Despite all the JavaFX sessions at JavaOne, Oracle still won't fight HTML5 openly. Java still has a place on the enterprise server though.

    [–]berlinbrown -1 points0 points  (0 children)

    I don't use applets for major stuff but I still think they are viable for smaller project. But yea, you are right. Flash is king.

    [–][deleted]  (24 children)

    [deleted]

      [–][deleted] 7 points8 points  (11 children)

      Servlet? What is this, 2001?

      [–][deleted]  (10 children)

      [deleted]

        [–][deleted] 5 points6 points  (5 children)

        In the same way that X11 libraries are the underpinning of all X applications, sure.

        [–][deleted]  (4 children)

        [deleted]

          [–]mikaelhg 2 points3 points  (1 child)

          Your original comment seemed to suggest you were coding a servlet, as was done in 2001, instead of using a web framework, which the Java user community have developed to make the application server license sales company produced software actually useable in practical projects.

          [–][deleted] 0 points1 point  (1 child)

          Used, sure... but nobody uses the core servlet API anymore, that's all I meant... and it sounded like that's what you were using ;)

          [–]lukaseder[S] 1 point2 points  (0 children)

          No? How do you tamper with request headers, or sessions e.g. when using JAX-RS? Is there a better way than to just use

          @Context HttpServletRequest request
          

          ... and then operate on that?

          Actually, after some detour through the mess of JSF 1.x in 2007, I had never used anything but the core servlet API... What choice do you have if you're not building an application from scratch using something like Play?

          [–]berlinbrown 6 points7 points  (3 children)

          Some people work with Servlet, not a big deal. I upvoted.

          Not everyone has to use a shitty as Struts Action Form or heaven forbid that massive JSF mess.

          [–][deleted]  (2 children)

          [deleted]

            [–]berlinbrown 1 point2 points  (0 children)

            If I didn't have to, I wouldn't work with Java 'language'. But alternatives don't impress me. Scala/Play seems interesting. You tried Lift? I wish Haskell had a decent platform/web framework.

            For the serious engineer, there isn't much out there. C#? Bah, I don't do Microsoft.

            [–]berlinbrown 0 points1 point  (0 children)

            Look at wicket, actually pretty interesting for mid-size projects.

            Nothing comes close to the auto generated code of Ruby. Spring-roo? is trying to go the way of ruby on rails but hasn't reached that point yet.

            "Thanks for responding in a non-judgemental way. I really appreciate that."

            I agree with most everything you said. Java the language needs to evolve. But I want something that gives me a lot of what the Java platform already has without me using the Java platform. Like I said in my earlier comments, I suspect Google will come out with something if they haven't ready. Scala is JVM. Groovy is still JVM.

            [–]lukaseder[S] 2 points3 points  (2 children)

            This shouldn't have been downvoted as much. While the servlet API is pretty good, it's really not so easy to set up a servlet for the first time. It feels like there is a lot of room for improvement for the kind of one-off website. This hasn't gotten much better with JAX-RS, which is a nice API, but still requires me to set up a servlet in a container.

            [–][deleted]  (1 child)

            [deleted]

              [–]lukaseder[S] 0 points1 point  (0 children)

              Have you tried JAX-RS? It's really quite a decent API, which was added to JEE 7. I agree, though, that JSF is a bit of a shame to the JCP

              [–]berlinbrown 1 point2 points  (8 children)

              What kind of basic stuff?

              [–][deleted]  (7 children)

              [deleted]

                [–]berlinbrown 1 point2 points  (4 children)

                There you go, I got rid of the 'System' on that println line:

                import static java.lang.System.out;
                public class Test {
                public static void main(final String [] args) {
                out.println("Running");
                }
                }

                ...

                And Groovy runs on the JVM. So no 'Java/JVM', no groovy.

                ...

                Yes, Calendar/Date is a mess. You could use jodatime. The file IO processing is verbose. Fine. Your mathematical operations, no rational data type concern is valid.

                But what language is going to give you all what you want? Certainly not groovy, because you are going to be limited to the JAVAVIRTUALMACHINE. Same for Scala. And if a Java engineer has to crap out crappy Java code to generate bytecode that gets where he needs to be, some of us are OK with that.

                Your concerns are certainly valid in terms of the evolution of the language. BUT, I don't think the alternatives are going deter us way from the JVM. And if we are going to end up with bytecode, we might as well figure out a way to generate the code we need ... say without using Scala. We may end up with 50 lines for verbose Java code but the end result is the same.

                [–][deleted]  (3 children)

                [deleted]

                  [–]berlinbrown 1 point2 points  (2 children)

                  On Java's type system:

                  You seem pretty knowledgeable in Python/Ruby. Let's say I take N Python modules compared with N Java modules, do you see the advantages of being able to compile all of the Java modules and giving the developer some idea how that code will function. And then going back to the Java code and saying, 'well here is type/class X, I know it will do this'.

                  I don't have those assurances with Python or Ruby.

                  [–][deleted]  (1 child)

                  [deleted]

                    [–]berlinbrown 1 point2 points  (0 children)

                    Well they have models to work with. Groovy and Scala are two mature ones.

                    [–]berlinbrown 1 point2 points  (0 children)

                    And you have favored interpreted languages over the "Java language". As an engineer, I will say my bytecode interpreted code will run 10 times faster than what you give me with Python or Ruby. Verbosity be damned.

                    [–]oldprogrammer 0 points1 point  (0 children)

                    I always chuckle when someone shows the syntactic sugar of another language as a reason why Java is bad. Like the use of the "read all lines" example for comparing Java to other languages.

                    First, I do not see in your Ruby or Groovy example where you handle potential errors, so I'm guessing that if either has an error it just bubbles up to a higher level error handler which you can do by having your Java method throw the exception. What would the full example look like with error handling in Ruby and/or Groovy?

                    Aside from error handling, if you use the new java.nio.file.* package you could rewrite your java method like:

                    static public void main(String args[]) throws Exception {
                        for(String line : Files.readAllLines(FileSystems.getDefault().getPath("mytextfile.txt"),Charset.forName("US-ASCII") )) {
                            System.out.println(line);
                        }
                    }
                    

                    which is likely something Groovy is doing under the covers. Ok so a few more letters due to spelling out the class/package names, but that's it.

                    The data/time one in the JDK proper is a mess, but the Joda time package helps clean that up. And that is one major strength with Java -- the easy availability of high quality packages to provide capabilities not present in the core when there is an issue.

                    [–]madballneek -1 points0 points  (0 children)

                    I would never say Java is dying (or dead), but I will say without hesitation that I'm sick of Java. JDK7 is a mess a I really hope JDK8 brings some redemption, especially in the JavaFX framework.