Java 10 and beyond – a look at the potential language change
zeroturnaround.com
zeroturnaround.com
I heard one good approach is to start testing newer releases in your CI systems as soon as possible but wait for the next LTS ever few years to migrate production.
Apache Groovy hasn't even updated its syntax to support Java 8 lambdas. It's coming in Groovy 3, apparently.
If Groovy's project managers at Apache don't want a Groovy 3 release to avoid a debacle like Python 3 or Grails 3, then they should just come out and say so. Instead, they're letting others waste their time working on it while putting up roadblock after roadblock to slow it down.
The reason the community is struggling with Java 8 to Java 9 is that 9 broke a TON of stuff. It's not backwards compatible at all. Basically every non-trivial app broke. The breakages are mostly in things that were technically never guaranteed, even trivial things like the version number went from "1.8" to "9" which makes sense but broke loads of programs that tried to parse the version.
But some of it is also just bad processes and habits in the community. Some of the programs that broke due to the version number change from 8 to 9 broke again from 9 to 10 just months later because they had enums that listed every possible version.... their codebase literally encoded the assumption that new major java releases hardly ever happened!
http://www.theregister.co.uk/2016/12/16/oracle_targets_java_...
Please someone correct my perception here, but it looks the the goal of the rapid release cadence is now to get more enterprise support contracts: if you want to stay on LTS, you have to pay.
In the end the thousands of businesses an thousands of open-source projects that use Java will continue to use Java. Others will invest in the FUD around Java and Oracle. Life will go on. It'll be interesting to see who comes out on top.
http://www.oracle.com/technetwork/java/eol-135779.html
Aren't we talking about the company that wants to copyright api no matter what effect his has on the rest of the industry.
The same oracle that buys and kills interesting project making the world a less interesting place.
The people that are suing google for violations that the original owners of the IP tacitly allowed.
You are awful quick to call criticism of oracle FUD and delusion. Are you sure you don't work there?
All corporations are alike and many geeks are naive to assign human behavior to companies.
It looks like they're firing their pesky B, C, D, and F customers and keeping their A ones, ie the ones who will pay millions in maintenance.
The rest of us, who are currently tied to Sun Java for its stability and who aren't going to pay big maintenance, will have to switch to OpenJDK if we want stability. It's either that or constantly port every 6 months, and pray all the kabillion dependencies we have work okay.
1. https://news.ycombinator.com/item?id=15886333
2. http://www.businessinsider.com/oracle-cso-goes-against-bug-b...
That would have made a lot of people happy.
I don't even use OpenJDK, rather always install Oracle commercial's JDK.
Given how much Google and IBM cared for Sun's fate, I doubt very much they would pick up OpenJDK development, if all those devs went away.
Then you could enjoy your free license with a programming language frozen in maintenance mode.
Anything that stops businesses asking me to target Java 1.4 on abandoned Red-Hat 5 servers is good on my book.
Among the reasons Python devs cited were that it was hard to get printed correctly in books, and hard for users to write in general, depending on keyboard layout.
String s = <<<TEXT
<html>
<body>
contents
</body>
</html>
TEXTHint: Let programming languages use characters 1) in the ASCII character set and 2) not diacritical marks, and you'll be fine... It's honestly not rocket science. I think it's a programming language designer's responsibility to just know these things in 2018.
In the competing .NET Framework, @ is used for raw string literals, as in @"raw string". The diacritical marks ~ and ^ do occur there for bitwise logical operations and ~ in declarations of destructors but I don't think this is optimal. I never really understood why they inherited C++'s destructor syntax to have a semi-obnoxious special symbol just for this particular one case that is used at most once per entire class definition, that is shared with bitwise complement (???), no less... Is it so bad with keywords? Or why not just use "!" as in "not". It would at least make more sense.
I think the issue he was speaking to was that if many of the new features require doing things in a new way then it really is something new. But your point is well taken as well. C++ is still C++ whether you use standard templates or not.
The GCC C++ parser is over a megabyte of ASCII text. Think about it: it takes over a million characters to figure out how to parse C++ code. This complexity is partially because there are so many ways to do the same thing.
All auto parameters, or make it a template? `if constexpr` or `std::enable_if_t`? Macros for generic programming or variadic variadic template templates? Overloading or specialization?
I love C++, and backwards compatibility is something that's been valuable for it, but it certainly comes with its challenges.
Firstly, nothing requires you to do things in a new way.
Secondly, if “you could already do that” implies “not really something new” for a programming language, updates to the syntax of programming languages can never count as “really something new”.
I'd much rather see type erasure fixed, as that messes up every single language based on JVM. But that would be like "the incompatible change" of a decade...
What? Type erasure is one of the main reasons why the JVM is targeted by so many languages (Java, Clojure, Kotlin, Scala, Groovy, JRuby, etc.). Had the JVM gone the way of the CLR the programming language landscape would probably look a lot different than it does today.
Perhaps you mean lack of support for value types? That does affect every language running on the JVM.
As someone who grapples with erasure as well, I haven't heard this argument before. Could you explain that?
Learning from other peoples' code is not generally considered harmful.
If it keeps going in its new direction, soon they'll just be able to name it javascript. :)
int val = switch (str) {
case "foo" -> 1;
case "bar" -> 2;
case "baz" -> 3;
default -> -1;
}
Looks a lot like Scala: val foo = match (str) {
case "foo" => 1
case "bar" => 2
case "baz" => 3
case _ => -1
}
Interestingly the underscore character is now reserved in Java, wonder what use case(s) they have in mind there?> We are "reclaiming" the syntactic real estate of "_" from the space of identifiers for use in future language features. However, because there are existing programs that might use it, it is a warning for identifiers that occur in existing syntactic positions for 8, and an error for lambda formals (since there is no existing code with lambdas.)
Example:
BiFunction<Integer, String, String> biss = (i, _) -> String.valueOf(i);
It basically means that one of the lambda parameters is unused.And citing this JEP 302:
We are now free to complete the planned rehabilitation of underscore
to indicate an unused lambda, method, or catch formal parameter. val emails = users.map(_.email)
Unlikely that will make its way into Java anytime soon, if ever, but it would be a nice enhancement -- being forced to pepper your code with lambda expressions a la `x => x.foo` is annoying when the alternative `_.foo` conveys the same meaning.In principle - it's just convenient in many ways.
The only reason Java still exists is because it created a generation of professionals who only know Java, only do Java, and won't learn anything else. That group is still large enough to maintain critical mass and create new greenfield Java projects despite the fact that Java is a shit-poor choice of language for those projects today.
Also that whole "Android" thing happened.
Yeah, and Google made their opinion of Java quite clear by adding first-party support for Kotlin.
As for Java being popular because it has mindshare, you are agreeing with my original point. It doesn't continue to exist because it's a good language. It continues to exist because of inertia.
Which is good for Android developers as they crave that syntactic sugar. Unfortunately, businesses have different priorities.
>As for Java being popular because it has mindshare, you are agreeing with my original point. It doesn't continue to exist because it's a good language. It continues to exist because of inertia.
It may not have all of the syntactic sugar that other languages have at the moment, but given its new release cadence its only a matter of time before it reaches feature parity.
Somewhat nicer syntax and some functional features isn’t going to fix the wider problem Microsoft has, which is the reason for .NET core existing, I suppose.
True, .Net Core exists because Microsoft eventually realized its mistake of tieing its programming framework too closely to its operating system. But... that mistake is now in the past, for some years now.
>all the interesting things in cloud happen outside of Redmond.
We're getting a bit off-topic from OP with this, but can you please give an example of some other cloud provider's service for which there is no Azure equivalent?
I'm not referring to Azure feature line items, but rather that in the industry, Microsoft is usually an afterthought.
The innovation happens elsewhere, and then Microsoft has to themselves try and port it to Windows. If you're running on Azure, eventually you're running on Windows (yes yes, it can do Linux VMs).
We did .NET forever, and always had to try and make do with half baked adapters and integrations when wanting to use things like Hadoop or Spark back in the day, not to mention containers took forever to come to Windows.
Got tired of waiting for Microsoft or the community to port things over, just switched to the platforms and languages where this was all native. I'm sure you'll say it's better now, I've been hearing that for quite some time now, but every time I look, it's still confusing, muddled and in beta.
Kubernetes, JVM & Node.js works great for us now, and GCP is absolutely rock solid and performant.
And we don't have to wait for Microsoft to bless us with the only implementation we're ever going to get, the OSS community is much, much, more active outside of the Microsoft bubble.
Language-wise C# overtook Java quickly, but SUN was all about openness and about not being big bad Microsoft, and that resonated with the majority of idealistic developers.
If you take people who instead learned Python as their first language, and put them through all the ceremony that is getting "hello world" to work in Java, you're going to get a very different reaction. A lot of this is very dependent on perspective.
For the record, I also learned C++ first. I also found Java to be a breeze. And then I discovered a whole world of other languages, and learned that in the grand scheme of things, Java and C++ are actually really similar to each other. Even Python is not so incredibly different, though it is vastly easier thanks to dynamic typing.
Compare any of these to stack based languages (Forth), array-based languages (APL), dataflow/graphical languages (LabView), homoiconic languages (Lisp), dependently-typed languages (Coq), etc. There are so many paradigms that are so dizzyingly different from each other. C++ and Java really are much more similar than they are different.
And it's worth pointing out that many if not most of these, though they would probably induce shock in a typical C++/Java programmer, are actually built on top of a small set of core concepts that is probably more coherent than either of Java or C++. And this matters a lot for people who are learning truly from scratch. There isn't necessarily enough data to make any definitive statements here, but there are schools that start with e.g. Haskell as a first language, and offhand I would probably say they get off the ground faster than a lot of Java/C++ introductory courses I see.
It's one line with the official java REPL jshell. Two lines, if you want a GUI (Swing).
And with the introduction of Graal and Truffle I'd say Java is one of the more interesting languages to follow nowadays.
It has great library ecosystem, concurrent data structures, sane enough memory models.
There is great new cutting edge work going on on the JVM: G1GC, grasp/truffle, etc. There are great distributed systems/platforms like gRPC, zookeeper, cassandra, kafka, and hadoop.
The IDEs are great. Debuggers are fantastic. Hot patching live code could be better but it's not hard if you plan for it.
As for the Java language itself: sure it can be a bit cumbersome and verbose from time to time. But reading even the trickiest code is usually pretty explicit and decipherable. Not being the most "featureful" language plays to it's strengths. I find myself missing Java when in python or go as much as the reverse. It's part of the reason why Kotlin seems to be taking back some Scala fans. Kotlin is more Javay.
As much hate as it gets its a surprise to hear that people think it's confined to legacy work. From where I'm sitting I'm pretty optimistic about its future.
The JVM is a different beast than the one you knew 15 years ago. GC is not a problem (usually) anymore. Change of hardware? Change of OS? Want to develop on something else? No big deal, it's all on the JVM. And it's a pretty damn fast JVM.
It's got an extensive library ecosystem that isn't going anywhere. Because enterprise uses it so extensively, there's lots of support for it, lots of demand for it. Amazon is big on Java- heck they hired Gosling last year.
Java is stable, not going anywhere, and an easy choice to make. So yes, people are happy that it's getting better linguistically. Stop being a language snob.
Java should have focused on being a better "business" language. Type inference, string intrinsics, built-in regex, intrinsic arrays and maps, lightweight objects.
I love functional programming. For my own projects. When I want to get my lambda on, I'll use Clojure. No way I want to wade into someone else's extravagantly tortured dynamically typed, meta tagged, lambda spaghetti code.
Annotations, optionals, generics, lambdas, and other cargo cult inspired additions have reduced Java's core value proposition.
Fortunately the tooling and JVM are awesome sauce.
I think the biggest problem is that it is in the nature of most developers to want to live on the bleeding edge. We want to have these new shiny purple things. And it just hurts us deep down inside to go with the safe and mature option.
Again, nobody is forcing you to adapt a new version as soon as it comes out.
And also, the cadence means that java changes will be much smaller, so no more big bang like Java 9.
The only real problem might be the bytecode releated libraries like ASM/bytebuddy, those need to move faster then previously (and they are, e.g. butebuddy already supports java 11 bytecode version).
If you can do testing in a month than use non-LTS, it is quite simple.
However they adopted the versioning scheme from Ubuntu and I honestly think it is confusing.
What really is going on is this:
1 Major version 1
2 Major version 1 + latest and greatest features pack 1
3 Major version 1 + latest and greatest features pack 2
4 Major version 2
5 Major version 2 + latest and greatest features pack 1
6 Major version 2 + latest and greatest features pack 2
7 Major version 3
8 Major version 3 + latest and greatest features pack 1
9 Major version 3 + latest and greatest features pack 2
...
Picking a version scheme that made that obvious would have been helpful.With an increment in the major version number indicating that a release contains significant new features and/or old features being removed.
The scheme you propose would imply that it is only LTS releases that get significant new functionality.
And as far as the LTS version of Java, 3 years seems a little long to wait for any updates but 6 months seems short to to drop support.
If I ever get back into Java, it will be solely for Android development. Does any of this affect Android development?
I haven't used Java in years, is the Java ecosystem under Oracle as bad as it appears from the outside?
Then we will see where Kotlin lands, specially since Fuchsia uses Dart.
We're also unlikely to benefit since vendor software can't upgrade (or won't certify new versions) and the mannequin developers consultancies place offshore can barely work with Java 1.4 concepts. Best I can hope for is improvements in GC and better defaults.
The quicker pace with smaller changes will hopefully help with this friction.
At first I read it like: "Man at this point there is 0 reason to use kotlin".
But come to think about it, it makes just as much sense.
Perhaps you can explain why you think there is 0 reason not to use Kotlin now?
Can’t wait what next 10 will bring - native json and html/jsx/xml perhaps?