58 points · by philonoist · 3y ago · 144 comments
I was expecting some novel analysis of in depth data scraped from GitHub APIs, or the results of a qualitative survey of big Java shops, or … something?
Instead what we got was a reposting of a few surface level stats pulled from other blog posts which have tolled the death of Java (or C++ or whatever) ad nauseum.
It’s as if the author started with a narrative and went searching for the line plots to justify it.
To be clear I don’t doubt the growth of Java amongst new learners is slowing down. Partly perhaps due to an image problem relative to other new languages, but likely also due to having somewhat saturated its “total addressable market” and not repositioning itself in new “markets” in the way that, say python has done.
But it’s still a great language for many categories of problem (e.g. high throughput live service) and has rich ecosystem. Build what you like with whatever tool is good for the job. Stop using bad stats to motivate your recent learning choices and just go build stuff :-)
Each language shines for specific applications and the provided public data adds little value without clusterization per each application type.
Plus, GitHub is not representative of the real world. As an example, how much Cobol is versioned there compared to the number of LOC in production today?
Also, less new questions on SO may just be a symptom of a mature language instead of a decline.
This is an interesting topic that rarely gets addressed objectively.
But, yes, there are definitely limitations to GitHub and SO data. You'd probably have to do some primary survey research of the audience in question--e.g. large enterprises--to get better numbers for that audience. And, even then, my experience with trying to get some sort of handle on the amount of C code out there years ago was that few people really have a great grasp on lines of code (? an imperfect measure in its own right) of various languages in use in their organizations.
I wouldn't be so sure if I was you. A lot of work is being put into JSpecify [1] lead by Google and with most major players in the Java ecosystem participating. If it is a success we might see it in the language one day and not just with annotations.
1) Not crashing-and-burning on simple "Hello World" level use-cases (e.g. working in a Python terminal, a 3-liner script, etc.)
2) Giving actual performance gains in typical cases
3) Allowing code to change in both directions, quickly and easily
4) Integrate well into other parts of the language (e.g. list comprehensions or iterators / generators in Python, or multiprocessing)
I also don't like the amount of verbosity added. I can describe a system which would do all-of-the-above, but I don't think I could have independently invented it. It's based on using JS and Python async / await for a while, and understanding where things were done wrong.
On a mile-high level, I'm also ultimately not sure this is the right model. We:
- Created cooperative multitasking (e.g. in Windows 3.1 and earlies)
- Found pre-emptive multitasking worked better, in part since people were bad at deciding when to release control
- Re-invented cooperative multitasking within apps with async / await
I think there is a more dynamic, higher-level programming model where I describe what needs to be done. Just-in-time profiling and optimization, decides what to do synchronously versus asynchronously versus in a new process versus e.g. on a GPU. An operation like:
[functional_function(x) for x in l]
Ought to sit on CPU synchronously if l is small and f is fast, in their own process asynchronously if they are medium, and on a GPU if they are massive and slow.When you're building software with a design lifespan of decades or more, this stability is advantagous. You don't want to have to go back and make big code changes (ie: pay increased maintanance costs) every few years because the libraries and frameworks you used are moving targets.
Recent Java has just made threads cheap, so async concurrency is much simpler and more consistent with existing libraries and APIs.
It’s not hugely helpful for a UI-bound application which occasionally needs to move some work into a background thread to cut down on UI jank.
Kotlin’s suspending function syntax effectively lets you know which operations are going to (potentially) take a while, so you can make sure the UI thread isn’t blocked, and also make sure you’re communicating to the user that something is happening.
Why make life more difficult when you can have code that reads linearly?
In order to replace Java and it's ecosystem one would need to offer MUCH MORE than just null safety...
But certainly if I were to add new features to an existing Java codebase I’d use Kotlin. The interop between the two is fantastic and for me the null safety alone makes it worthwhile.
C# was a better language than Java for some years until Java caught up again.
Java is dying in the sense that Beteigeuze is going supernova. Some day it will happen, but it may not be in my lifetime.
There were lots of Java is Dead on Desktop. ( And that is certainly true from a consumer standpoint ). But I dont remember a single Java or the JVM ecosystem is dead article.
Comparatively speaking, there are 10 times more Ruby is dead article....
C# is 2000. And Windows-only for a very long time.
…And an emphasis on long term stability. The ecosystem seems to understand this. If you’re building things that will last over a year, use Java.
Plus 99% of the production code I ship is in Java.
Because of the time Java was released it’s still common to think this way. Not a slight on Java, there’s things we’ll believe in 2040 that 2023 people won’t quite feel the same way about.
The companies that don’t maintain end up replacing. And perhaps paying even more, when the big bang replacement project has troubles.
At this point it's almost a meme to say that the hyped language of the moment is killing the established players based on normally weak and disputable claims. Anyone who has been around long enough heard this many, many times for all new language in the block. I have no idea if people will be starting new projects in 10 years with kotlin, but I'm sure the will with java.
The community activity can affect enterprise use as well. For smaller, new projects that do not depend on existing codebase, companies realize that they can build things using a different language which may bring in faster development speeds, active community support and other benefits. Also, if a smaller portion candidate pool knows Java or masters Java, it forces companies to rethink their direction. (At my company we have a lot of trouble hiring people who want to write new code using some legacy stack)
Anecdotally, I know as a matter of fact that companies are moving away from building UI in Java. (I know, this is not the best example.) There used to be a time where people create lots of apps using Java Swing and frameworks based on it. Not anymore -- companies are running away as fast as possible, because things break all the time and hardly anyone is maintaining anything. Guess what they choose instead? The web stack is a favorite.
The issues are elsewhere. For example distribution is/was harder than for a web app, though jlink and Conveyor [1] makes it much easier now than it used to be.
[1] https://hydraulic.software/ (disclaimer: my company/product)
Go has a solid stdlib. Go can cross-compile and provide single-binary distribution.
Go doesn't have and client-side JVM dependency nonsense. Literally just ship the compiled Go binary for your app, everything is "batteries included" for the user. Doesn't matter if you're writing a simple CLI tool or a server.
I even don't write shell scripts any more, I write in Go and ship the binaries. It's cleaner and more robust to code and it's easier to deploy because of zero dependencies.
I really hope you're trolling to come up with this kind of statement.
I quite like it now in some ways, its packaging system allows for comparatively rapid development, you can find libraries for a lot of stuff, and it is quite an expressive language. In other ways it's in a sad state - the reflexive use by most projects of quite heavy frameworks that purport to do a lot of work for you and then fail at various edge cases while adding multiple layers of opaque magic and tons of transitive dependencies... it's less than brilliant. And startup times are an issue.
Go is nice too. It has some shortcomings in the breadth of its ecosystem, but I'm sure that will grow with time.
Yes, I agree.
But at the time, fighting with Tomcat stack traces was often still preferable to a number of other options at the time.
Its obviously been a while, but IIRC for web stuff if you were not a JAR shop, then you were (probably) using ColdFusion or PHP, because the Microsoft badge couldn't be trusted at the time to be put on the web. And back then PHP was v4/v5 where it deservedly gathered community hate unlike today's pretty decent v7/v8. ColdFusion was generally ok though, but I think its largely going the way of Java these days, overtaken by better tech.
Seems like your knowledge about Java is ~10 versions old.
So there is still a JVM dependency then, you're just hiding it.
How does that JVM bundling work out for bloat ? I'm guessing it increases the size of the package, and the JVM still has a tendency to eat RAM for breakfast like it always did ?
Does JVM still need "tuning" for production via obscure flags and XML file params ?
I don't really care about a few mb extra size of bundling. Maybe some use cases do. I haven't tweaked jvm params in years. For a dockerized cloud deploy it's fire and forget.
If we're talking about bloat, the current python app I'm working on needs ~20x as many nodes as a similar jvm project I worked on earlier..
Your other comments seem to fall into the mindset of those that think that being able to control or configure your environment is somehow bad because it requires you to know something about that environment.
As for package size, there are people who bundle a stripped down JVM with a single app, but I don’t think that’s a good use of time—I’d much rather declare a dependency on the complete OpenJDK, and rely on the system package manager to install exactly one copy of it for all apps to use.
> It's cleaner and more robust to code and it's easier to deploy because of zero dependencies.
If you want clean and simple then C# does all this and is clean and simpler.
I don't like using Windows or Visual Studio for development.
You don't need Windows or Visual Studio (though Visual Studio [ie not VSCode] is actually pretty good with the native Mac edition).
I do a lot of C# (alongside mainly Go and Node) and the quality of the experience on a Mac is easily on a par, plus the language is much nicer in many areas than its peers (eg needing more than Go's maps and slices). It is Windows-first on the developer tooling, for historical reasons, but far from Windows-only these days.
I also dislike the way you have to manage a sln file— which doesn’t work as well as Go & other more recent languages with my preference for simple editors.
I also didn’t like the enterprisey culture that seemed to nearly always surround C# (this was maybe 10+ years ago, so this may have changed).
All that said, C# + Visual Studio was a remarkably productive combo.
Edit: changed all to most as I still need windows for some c++ specific stuff at the moment.
For deployments you can build self-contained which includes the bits required to run.
So for example I’m building a little browser game in my spare time. It’s a web app and a service. So 2 components. They are deployed to (ubuntu server cos I’m waiting for Amazon linux 202# to release) which does not have the .NET runtime installed. It’s used the built in kestrel server to accept web requests. So no nginx or Apache or anything. Tho I would prob add nginx if the server was public facing but since everything goes via a load balancer I don’t bother.
Java had a good run being one of the fastest rising languages in the late 90s, and it's still not ever yet - some of the biggest applications still use Java to this day. I have a feeling that Kotlin and GoLang are going to be some of the fastest growing languages of this decade, though.
It's my new year's resolution to learn Kotlin and GoLang, just incase they explode like Python has.
First of all, what do these various metrics account for? The article mostly states its about "popularity", without defining it. I suspect the definition vary with the source. And when it's a relative popularity, it should be dealt with care, since a lower rank may be just marginally significative if the competitors are at the same level.
Then, what do all those popularity trends in public websites show about the languages trends in companies? The article implicitly suppose they are the same, or at least are related, but that's far from obvious. For instance, a few years ago Python became the de facto language for teaching programmation in many countries, and I suppose that explains its boom in StackOverflow (4% to 16% in 8 years)... but was there the same boom in the professional world?
I also think the comparison to Kotlin is very shallow. It's not easy to compare trends between an old and widespread language and a much younger and rare language. In the same way the author claims that Kotlin is on its way to replace Java, I could claim that Python will get replaced by Nim. The data is there: Python's popularity is stagnating, while Nim's had a huge grow. But that would be absurd, since they are not in the same category.
Most of all, what does a decline mean? Since the introduction claimed there was a 70% increase in the number of developers over the last 3 years, the usage of Java could increase by 20% while its global share goes down. Would that count as a decline?
To put things in perspective that ranking still has Java at #3, one spot down from ten years ago (replaced by Python).
SlashData, another developer survey platform, published data in 2022 showing that there are now 5 million Kotlin developers worldwide, and that the number of Kotlin developers doubled in one year.
I agree doubling of developers overall doesn't make sense. I quick look suggests maybe up to about a 10% increase.
Looking back at the verbosity of the language and the horror of Enterprise Java frameworks, I would never go back to Java.
Everyone currently coding in Java should look into alternative JVM languages like Scala (or Kotlin, although it’s not as expressive).
Java may be in decline, but its scalability is still why it rules the enterprise roost.
Whether that is intrinsic to the language, or a reflection of engineering practices that surround Java is an interesting question.
Kotlin was not at all designed to replace java, anymore than typescript was designed to replace javascript
Starting from java 17, it's completely free.
https://www.java.com/en/download/manual.jsp
With the big warning that we should be aware this isn’t free to use with no strings attached, you need a subscription.
Again, I believe you when you say it has changed but historically using OpenJDK was the not supported option for a lot of products.
That’s just not the kind of software I’m looking for.
Given the clear pattern of Java decline and Kotlin growth combined with the near seamless interoperability between Java and Kotlin, I expect Kotlin will slowly but surely take over during the next 10 years.