DEV Community

Will Java Trend Towards Obscurity?

Ben Halpern on December 12, 2018

I'm forking another conversation: Comment on What Was The First Problem You Solved That Made You Feel Like A “Real Programmer...
Collapse
 
cjbrooks12 profile image
Casey Brooks • Edited

I believe that Java, as a platform, will never die. The JVM and its ecosystem of incredibly high-quality libraries, coupled with its deep roots in large-scale enterprise environments, makes it a worthy platform to develop for and will always continue to live on.

However, I do believe Java as a language will be increasingly replaced by Kotlin. Other JVM languages (Scala, Groovy, Clojure) might have tried to replace Java, but they never really delivered on that promise. They all did wildly different things using Java as a backbone, but simply aren't comfortable to devs used to doing things "the Java way". Scala brought pure functional programming. Groovy made it dynamic. But Kotlin is the first that was actually created to just be a better Java, and by-and-large if you're comfortable writing Java8-style code you'll pick up Kotlin very quickly and fall in love.

But a major part of the success of Kotlin is its perfect interop with Java. Kotlin is great because under-the-hood, it is just Java. There is nothing fundamentally different going on with Kotlin than plain-ol' Java. Both Scala and Groovy have their own runtimes which run on the JVM but aren't entirely compatible with Java. Kotlin just compiles to the exact same thing that Java does, which is a huge advantage for incremental migration, especially in large, slow-moving enterprises.

So, again, Java isn't going anywhere. But I do think it's moving the same direction that C has, being the language that underpins all others. And to that point, Javascript is moving in this same direction as well. It is a sign of maturity of the language, that it has gone from being a language used directly, to being part of the fabric for the next level of technology.

Collapse
 
jbristow profile image
Jon Bristow

The interop is good, but it’s not perfect. It’s especially bad when reflection is involved (see what happens when you deserialize data class Data(val SomeKey:String) with jackson.)

Other problems revolve around functions named to and in and is being unusable in some situations.

Not to mention that one gremlin dsl class named __!

Kotlin is nice, but IMO the interop is less nice than Clojure’s interop or even the F#/C# interop

Collapse
 
pancy profile image
Pan Chasinga

I missed the point of how the interop could be better in Clojure. For one, you can't write serious Clojure for Android, which is a major use case for Java nowadays. What I really disliked when using Clojure interop is that I ended up writing "clunky" Clojure just to fit into Java's way of doing things. Just having to use an object-oriented call from a Lisp syntax feels really messy.

IMO Kotlin has the best interop story so far for everyday use cases.

Thread Thread
 
jbristow profile image
Jon Bristow

True, but I almost never had to just "cast and hope" with clojure calling java code. When it comes to "serious" java (read: "enterprise class" with as much derision as possible) reflection tends to become involved and Kotlin's type system is quite a bit more conservative.

I agree about the awkwardness of

(let [b (SomeBean. )]
  (.setA b a-value)
  (.setB b b-value)
  b)

I tended to hide those away under the rug.

Thread Thread
 
pancy profile image
Pan Chasinga

That was spot on. I love functional programming and Clojure got me for a while until I had to do exactly that.

In my wildest dreams I see Lisp becomes a mainstream language people use to teach and learn programming. I'm still writing Scheme on the side sometimes.

Thread Thread
 
jbristow profile image
Jon Bristow

Tangentially, looking at my let, I saw a familiar construct staring back at me:

val b = SomeBean().apply {
  a = aValue
  b = bValue
}
Collapse
 
bosepchuk profile image
Blaine Osepchuk

I think it depends what you mean by "obscurity."

There are billions of lines of Java out there and while it will almost certainly not be the first choice for new projects 50 years from now, I'm betting that we're still going to be maintaining a lot of that code for the foreseeable future.

Collapse
 
garfbradaz profile image
Gareth Bradley

The COBOL of 2050.

Collapse
 
bosepchuk profile image
Blaine Osepchuk

That's quite likely.

Collapse
 
tiguchi profile image
Thomas Werner • Edited

What I see in that graph is Java's temporary upwards trend we had on Stackoverflow due to the massive popularity and impact of Android. When you add the tag "android" to the mix then you get another graph that illustrates the connection:

trend graph

Then came Google's absurd "API copyright" problems with Oracle and the push towards Kotlin (probably mainly to avoid further costly lawsuits and licensing fee extortion, not so much because the language is so pretty). I think the graph is just going "back to normal again". It's not like it's dipping below the point it was in 2009. But who knows what's going to happen next year :-D

Personally I think Java is here to stay and will go through a few more iterations that will make its syntax less verbose, such as the addition of lambda expressions, method references etc.

Collapse
 
tiguchi profile image
Thomas Werner

Actually after playing with different keywords I noticed that there is overall a downward trend when it comes to questions about mobile app development in general, here a comparison between android and ios and I also added Java and Objective-C for good measure:

Android vs iOS

I was initially thinking that cross-platform development platforms such as React-Native and Flutter are massively on the rise, but it doesn't seem to be the case to such an extent:

alternatives

But there is a significant trend up for web development questions:

webapp trends

Collapse
 
cjbrooks12 profile image
Casey Brooks

I do have to wonder how much of the downward trending of these graphs is actually due to lower interest, or simply the fact that an answer already exists and no longer needs to be asked. Upward trends are definitely indicative of growth, but downward trends...maybe just a mark of maturity and time, not necessarily declining popularity.

Thread Thread
 
tiguchi profile image
Thomas Werner

Interesting thought... A few more factors that might play a role:

  • Android documentation and tutorials have vastly improved over the past few years
  • Stackoverflow is heavily policed. Duplicates are usually closed. Poor questions deleted. I wonder if these are also taken into account in "Stack Overflow Trends"
  • Some questions don't have tags. It's rare, but a search for "android -[android]" (the word android minus the tag android) comes up with 100K results

So yeah, I guess it makes sense that we have reached something like "Q&A saturation" for Android.

I was also wondering something else along the lines... The graph's Y-axis unit is the percentage of all questions asked per month, and not an absolute amount of questions. I assume the amount of questions asked per month changes over time.

Assuming the active Stackoverflow community was also growing over the past few years, I guess we have overall more questions showing up every month compared to a few years ago where Java and Android were in its prime.

Maybe the actual amount of Java questions per month didn't go down, just the relative amount compared to all questions asked on the platform?

We do have more technologies in the mix that play a bigger role in recent years.

But on the other hand... I'm not a data scientist or analyst. I have no idea what all of that means :-D

Thread Thread
 
cjbrooks12 profile image
Casey Brooks

So many questions!!! Now I really want to see a data scientist here write an in-depth analysis of this stuff!

Thread Thread
 
mattmoranjava profile image
Matt Moran • Edited

@Thomas_Iguchi - I think a better metric than "Number of questions asked on StackOverflow" might be "Number of queries run on StackOverflow" - if the subject has reached or is near reaching Q&A saturation then StackOverflow becomes less of a place to ask questions on the subject & more of a place to search for questions that have already been answered. Does StackOverflow publish that kind of data, I wonder?

Collapse
 
thebouv profile image
Anthony Bouvier

Enterprise gets mentioned a lot when discussing Java, but tied to that also in non-enterprise environments is anyone doing data science.

Python and R might be the working languages of data science, but the landscape is held up by Java.

Think about all the Apache projects (Hadoop, Kafka, Solr, and so many more) -- those are all written in Java. Those aren't going away or being rewritten or replaced any time soon I don't think.

There's a lot more Java out there running amazing things that lots of devs just don't realize and just fall back on "Java is yucky".

Note: I don't program in Java, but I use a lot of things that are.

Collapse
 
sake_92 profile image
Sakib Hadžiavdić

Java is dead. Part #834356234 :)
No it's not dead, nor it should be!
Maybe not as concise (yet! but it will be) but a great, great language.
With pattern matching coming, value classes etc. better-java-s gonna lose!

Collapse
 
petarov profile image
Petar Petrov

Is it this time of the year again? 😉

wiki.c2.com/?JavaIsTheNewCobol

Collapse
 
ben profile image
Ben Halpern

This is generally the sober truth, but......

Java's interop must make with other JVM stuff is definitely notable. And the proprietary Oracle concerns (whether valid or not) sure seems like an extra wrench.

Collapse
 
petarov profile image
Petar Petrov • Edited

I would look at the subject also from the geo location perspective. I'm not familiar what the state of Java as a job requirement skill is in North America, but in Europe knowing Java pretty much guaranties you a stable longterm job.

I might be wrong, but I do not see that getting changed anytime soon. Of course, my comment doesn't stand against learning alternative JVM languages, which is what I'm doing at the moment as well.

Collapse
 
elmuerte profile image
Michiel Hendriks

the proprietary Oracle concerns

I think Oracle Legal threw the towel into that ring. Java is only becoming more and more a community owned platform. All commercial features from the original Java distribution have become part OpenJDK which is the default JVM distribution/reference implementation. I think Oracle is going to try to earn money by delivering an alternate Java runtime which is currently named GraalVM. It's open source and free for non-commercial use. It provides a whole bunch of interesting things which companies might be interested in to pay for.

Java as a language is also picking up speed again. Unless JetBrains is going to open Kotlin and make it a community language I think it will eventually lose from new-Java.

If the Oracle/Java debacle showed anything it is that for a single company to try to keep control over a technology can lead to its downfall, or lack of success.

Collapse
 
erikpischel profile image
Erik Pischel

Please also note the new Java release cadence. In the past, it took 3 years or longer for a major release with new language features. Nowadays, every 6 months a new version is released with new features. So Java will add features from other languages in the next years, e.g. record types, value types and fibers. That will make java as a language more competitive again.

The other side of the coin is: will users (like enterprises) keep up with this pace?

Collapse
 
tadman profile image
Scott Tadman • Edited

Java can both grow in popularity and use while also fading relative to other even more popular languages. It can also become so ubiquitous it's invisible, like C.

It's like how Perl is more popular than ever, but has slid a long way from the once dominant position it used to have in the 1990s.

Maybe Java has already slipped into relative obscurity.

Collapse
 
cjbrooks12 profile image
Casey Brooks

It can also become so ubiquitous it's invisible, like C.

Beautifully stated.

Collapse
 
awwsmm profile image
Andrew (he/him)

Not if I have any say in the matter

Collapse
 
rhymes profile image
rhymes

Collapse
 
gartboy profile image
Garrett

I really appreciate this gif using the lord of the rings font

Collapse
 
renannobile profile image
Renan Lourençoni Nobile

I agree with Casey, specially the deep roots part. Java, like COBOL, powers a massive amount of software and hardware nowadays. I'm not sure how popular it is for new applications, even more now that Kotlin is in the scene. But here at my job, there are several Java and COBOL applications maintaned and even new programs being created.

I think the "replace" part is due to the fact that startups haven't been using Java for some time now, Rails and the like have chewed the marked and continue to gain popularity.

On the other hand, qualified Java developers, from junior to senior, are a difficult professional to find around here (Brasil).

Collapse
 
dennyvasaya profile image
denny vasaya

If you are web developer, you may think so. because java rarely used for web development. PHP and node js preferred almost always. But when it comes to enterprise application development, I don't think java has any alternative. There is nothing as robust as java.

Collapse
 
djtai profile image
David Taitingfong

I think we'll see some gradual decline in Java being a very popular language, especially among your average college student - and I like to believe that colleges have pushed Java onto students for quite some time now. It was the language I learned in my intro to CS classes but that's not so much the case nowadays, or at least that's what I'm seeing/hearing. Lots of colleges are offering these intro courses in Python or JavaScript now.

As others have said, Kotlin is a likely replacement for Java seeing as it can pretty much do everything Java can, just with less code (correct me if I'm wrong) - web apps, backend stuff, Android apps, etc...

Never forget though!...Java runs on billions of devices, lolol.

Collapse
 
pancy profile image
Pan Chasinga

I really learned Java from writing Kotlin at work. My feeling is once you've closed that gap and learned how the JVM ecosystem works (how to start a project, install deps, restructure projects), then it becomes pretty trivial. My take is Kotlin is the only one that has the chance to "beat" Java. Nothing said it better than Google itself promoting it as an official language for Android, which is a major use case for Java today.

Collapse
 
iuriimednikov profile image
Yuri Mednikov

Hi,

  1. Scala and Clojure were mentioned in comments, but they cannot be replacements for Java in any case. Do you know a good web framework for Clojure? That's a point. Scala is quite limited in its audience. And finally both run on JVM, not vice versa, not Java runs on ScalaVM.
  2. Java would still have a future in teaching, because it is a very good language to teach OOP and algorithms. It is easier than C++ to learn. And there is a lot of academic literature written for Java.

BUT
When I started my programming way, Delphi was incredibly popular, but after Delphi 7, the platform began to decline very fast. But it is still in use, there is a lot of software written in Delphi, that somebody need to maintain and update. And now you can get a good deal if you know Delphi (but on a very high level, not just Hello world). Nobody remembers Borland today; you can use Lazarus - open source replacement.

Maybe Java would come the way of Delphi? Who knows. Actually I don't care too much about it.

Collapse
 
lincpa profile image
Lin Pengcheng
Collapse
 
rrampage profile image
Raunak Ramakrishnan

To put a different spin on this, some traditional Java "patterns" (SynchronizedSingletonFactoryFactoryBuilder, 30 circles of inheritance hell) are trending to obscurity as Java starts getting more functional features like lambdas, better pattern matching (coming soon) and record types. There are upcoming changes in JVM itself for value types, non-erasure of types for generics during run-time which will make JVM even better as a polyglot platform.

Collapse
 
darkain profile image
Vincent Milum Jr

Don't worry. C/C++ will trend and fade into obscurity, too. I mean, just look at all the micro controllers such as Arduinos and ESP chips that all are entirely based around C/C++ toolchains!!! oh... wait...

Collapse
 
alainvanhout profile image
Alain Van Hout

Just to give some perspective, try adding Ruby or JavaScript to the mix. Surely those aren't actually in decline.

Always keep in mind: lies, damn lies, and statistics ...

Collapse
 
rhymes profile image
rhymes • Edited

Ruby is a little bit on decline, at least on StackOverflow: insights.stackoverflow.com/trends?...

In comparison, look at what happens if we add Python insights.stackoverflow.com/trends?...

Collapse
 
alainvanhout profile image
Alain Van Hout

Indeed, and I don't really have the impression that Ruby is already partway fading into non-existence (as the graph somewhat suggests, given the decline and the general low absolute count itself). As to Python, in the graph it has overtaken Java, and completely overshadowed most other languages that I tried. Taking the graph at face-value, it would be reasonable to expect Python to be the only real game in town, but that surely isn't the case.

And that's my point about these kinds of graphs in general. As Inigo Montoya would say (if he were a statistician): I don't think that graph means that you think it means.

Thread Thread
 
rhymes profile image
rhymes

I agree :-)

Ruby is alive and well, Python had a surge because of data science, AI and ML, Java is alive and well (maybe less adopted by new Android apps, that's it). All of three are quite old languagues.

It's really really hard to effectively measure "obscurity".

Perl is the perfect example, I haven't heard about it in years, it's not the cool tool everyone is talking about anymore but it's not dead either.

Collapse
 
grayjack profile image
GrayJack

I hope Java language just dies out, I hate the languages, though I like the plataform

Collapse
 
thomasjunkos profile image
Thomas Junkツ

»In the long run we are all dead«
John Maynard Keynes

Collapse
 
tadman profile image
Scott Tadman

"Proves to warn that he not busy being born is busy dying." –– Bob Dylan

Collapse
 
gypsydave5 profile image
David Wickes

Will Java Trend Towards Obscurity?

I sincerely hope so.

Collapse
 
lepinekong profile image
lepinekong

If you want a job in big corporate world between Java and Kotlin, you'd better still learn Java. Of course if you can learn both you'll have more opportunities ;)

Collapse
 
bgadrian profile image
Adrian B.G.

No, never.

Signed, a Java hater.