28 ms·
Java 10 and beyond – a look at the potential language change
- bitL 8y agoThose changes seem to look like a completely new language, cross of Java/Scala/Swift - why don't they call differently, like Jalaft? The main reason to use Java was its backward compatibility. If I needed to learn a new language every 6 months, I'd learn another one to be honest.
- tytytytytytytyt 8y agoWill it not still be backwards compatible?
- bilbo0s 8y agoWell that's true. 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.
- stochastic_monk 8y agoThat's part of why it's such a nightmare to parse. 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.
- Someone 8y ago”if many of the new features require doing things in a new way then it really is something new.” 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”.
- CrendKing 8y agoIf a new language feature is available, someone in your team will start to use it, because it compiles, and code becomes shorter, so why not. And you will have to review their code daily, which forces to "relearn" the language. I think this is why OP complains.
- nradov 8y agoWhat's wrong with relearning the language? That's nothing new for developers.
- bitL 8y agoWhy wouldn't you rather learn a new one if your old one is changing rapidly into a weaker version of some other language that did it better already? I personally don't care at all about those new things; I have them in Scala, I don't need them in Java. I can mix those two as I like anyway. 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...
- virtualwhys 8y ago> I'd much rather see type erasure fixed, as that messes up every single language based on JVM 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.
- xg15 8y ago> Type erasure is one of the main reasons why the JVM is targeted by so many languages. As someone who grapples with erasure as well, I haven't heard this argument before. Could you explain that?
- rossjudson 8y ago
- elygre 8y agoIt will remain fully backward compatible. No need to use new features, and all existing code will compile.
- ckarmann 8y agoThese are just syntactic sugar, not going to change much to the way Java programs are coded. I found these changes rather tame compared to historical ones. Java 8 (lambdas), Java 5 (generics, annotations) and Java 1.1 (inner/anonymous classes, reflection) were far more disruptive.
- lovelle 8y agoI do not agree with that, this is not just syntactic sugar, for example in case of large 'else if' statements the complexity to choose proper branch is O(n), instead with pattern matching the chosen branch will be at constant time.
- ckarmann 8y agoWhile the article mentions Pattern Matching, it seems to be something for the distant future. I was referring changes of Java 11, which seems to me the focus of the article.
- lovelle 8y agoIf I am not mistaken, Pattern matching will be included on Java 11, please correct me if I am wrong.
- rb808 8y agoI agree, its a complete change in paradigm. Lots of projects are a mix of the old and new ways of doing things which is a mess. Developers too - are you a traditional style Java dev or a new style? If it keeps going in its new direction, soon they'll just be able to name it javascript. :)
- zmmmmm 8y agoThe rapid release cycle is going to pose challenges downstream for all the people developing tooling and other aspects of the ecosystem which are not used to moving that fast (eg: Groovy still grappling with the module changes to Java9, let alone 10 or 11). While we all griped about it for many years, the slow pace of Java evolution was in some ways one of it's biggest features. I am curious to see whether the community starts to move fast too, or if actually what happens is that people completely ignore the non-LTS versions and we actually get an effective release cadence of 2-3 years or so in practice.
- giancarlostoro 8y agoThat's just it, some projects will likely try to catch up just in time for the next LTS, while others may run a similar set of release branches, one targeting the LTS or the latest release. It's really dependent on individual projects, not so much the whole ecosystem at once. In Rust we have web frameworks that run on the Stable compiler, and then there's Rocket which currently only runs on the nightly compiler (at least last I checked).
- steveklabnik 8y agoRocket is still on nightly, though getting pretty close!
- jldugger 8y agoHopefully the faster release cycle is tied with smaller changesets per release.
- kjeetgill 8y agoI think the jump to 9 is going to be a little rough while organisations figure out modules and all the new flags tickle into a billion build scripts but 10 and 11 don't seem too bad. 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.
- vorg 8y ago> Groovy still grappling with the module changes to Java9, let alone 10 or 11 Apache Groovy hasn't even updated its syntax to support Java 8 lambdas. It's coming in Groovy 3, apparently.
- raybb 8y agoCan anyone familiar with the Java ecosystem chime in here? Is this more of a marketing ploy it are they actually releasing features at a significantly faster rate?
- Hallucinaut 8y agoYes, there are new features and I would say at an accelerated rate (though slightly arbitrary). It also means features that were being punted back from releases (like modularity in jigsaw) get a chance to surface without waiting several years, which in turn allows releases to hit schedules since the downside is reduced.
- zaphirplane 8y agoYes, there is also monetisation of LTS versions which ppl seem to over see
- bitmapbrother 8y agoNew features are released every 6 months. Is there another extremely popular language with a quicker release cadence?
- sanxiyn 8y agoWhile Rust is not "extremely popular", Rust releases every 6 weeks.
- windust 8y agosure. It used to be that major releases were tied with major features. InvokeDynamic on 7, Lambdas on 8, Jigsaw on 9. So since these were the features that were expected, the release only shipped when they were fully baked. Now is on a train-release model. You get whatever is ready to ship (big features can't delay a release anymore).
- jryan49 8y agoYes, it's been getting faster and faster. We were stuck on Java 6 for 5 years and now we're getting stuff every 1-1.5 years.
- kzrdude 8y agoThe backtick is just a problematic character. Python 3 had good reasons to drop it, so I'm surprised when anyone else starts to use it. 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.
- zmmmmm 8y agoWhile those sound like valid concerns, it's been adopted by Javascript / ES6 already and for me the benefit of consistency outweighs them.
- zeroimpl 8y agoWhile this syntax looks decent to me, I'm curious why they didn't go with a heredoc approach, e.g.: String s = <<<TEXT <html> <body> contents </body> </html> TEXT
- jug 8y agoYup, using a grave accent as a symbol in this time and age of Unicode is just clueless. It's a symbol usually used as a diacritical mark for letters, like è. It's thus often a "dead key" (a key that awaits the next one because it is expected to be used combined with another), just not on US keyboards. How hard is it to at least consider the general set of Western keyboards before deciding upon these things? Hint: 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.
- sheeshkebab 8y agoFinally, multi line strings and inferred types. It only took 10 years. Can’t wait what next 10 will bring - native json and html/jsx/xml perhaps?
- forinti 8y agoI needed multiline strings in 1998.
- Nuzzerino 8y agoAs someone who hasn't used Java since the early 2000s, I am surprised that it took them this long to get some features that I have taken for granted for many many years elsewhere. What surprises me even more is that there are Java islanders treating this update as something to be proud of. Can someone enlighten me as to why this language is still popular? I get that there is legacy software that uses it, and therefore a demand. But what is the appeal otherwise?
- wging 8y agoAs far as speed-of-evolution, it is worth understanding that the slower speed is at least partly a by-product of different goals. This talk, "Stewardship: The Sobering Parts" by Brian Goetz, is informative and well worth the watch: https://www.youtube.com/watch?v=2y5Pv4yN0b0 https://www.youtube.com/watch?v=2y5Pv4yN0b0
- ktosobcy 8y agoIt has easy learning curve, it's verbosity while cursed upon makes it also easier to grasp the code by less-then-expert, it's performant, it has huge ecosystem, it can run everywhere. In principle - it's just convenient in many ways.
- random4369 8y agoC# ticks all the same boxes and is much better from a language point of view. 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.
- kllrnohj 8y agoC# was too tied to Windows for too long, it lost the mindshare outside of that ecosystem. Also that whole "Android" thing happened.
- rb808 8y agoI like quite like Java but Oracle scares me. They've started charging for runtime licenses, which I never heard of before. Oracle is a good enough reason to avoid Java. http://www.theregister.co.uk/2016/12/16/oracle_targets_java_users_non_compliance/ http://www.theregister.co.uk/2016/12/16/oracle_targets_java_...
- meddlepal 8y agoMeh. The Oracle bashing mostly feels like FUD. Yea you might run into license issues if you use the Oracle JDK, but the world has rapidly moved to using OpenJDK which is just fine these days.
- imglorp 8y agoYour fear of Oracle aggression is well placed. 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.
- dnomad 8y agoI think it's doubtful that anybody will be able to correct your FUD. Once you've bought into this delusion it really seems to trap people forever and rags like the Register are absolutely delighted to feed the fear with nonsense articles for precious clicks. Nothing can change the mindset. It doesn't matter that Java itself is completely open source (Open JDK), that Oracle isn't doing anything they haven't done before (you've always had to pay for support of EOL'd JDKs and JDK 8 is five years old like other EOL'd releases), or that, frankly, Oracle's actual track record here -- that is when you look at the actual actions taken by Oracle over the last ten years -- is generous to a fault. None of this matters to somebody who is committed to the FUD. 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.
- IAmLiterallyAB 8y ago
- dep_b 8y agoAssigning variables through a switch-statement is really nice. Looks almost exactly like Elixir does it.
- bjz_ 8y agoAnd many other languages before it - SML, OCaml, Haskell, Miranda, Erlang, Scala, Rust...
- Hallucinaut 8y agoJava users in the enterprise like myself in some of my client work won't be massively enthralled by this approach, though not necessarily for good reasons. Audit and compliance teams love to pick up on software versions not on the latest version, so the idea of having a six month churn just means I can see man-months of effort being plowed into no-op changes. 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.
- zaphirplane 8y agoWeird, why ? So long as the version is supported, compliance doesn’t raise the issue. Of course plenty of compliance is done by recent graduates working for big accounting firms
- sk5t 8y agoSecurity updates to the JVM/JRE.
- zaphirplane 8y agoThe complaint was about the affect of major version release frequency. Security fixs are done in bug fixes release
- virtualwhys 8y agoint 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?
- kovrik 8y agoBrian Goetz said: > 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.)
- sk5t 8y agoScala's pattern matching (which btw is structured "value match { ... }" - think of .match as an always-present extension method) goes much farther than it is easy to imagine Java going quickly; consider examples such as regexp capture decomposition, case classes, static type checking, and guards.
- krzyk 8y agoRegarding "_": http://openjdk.java.net/jeps/302 http://openjdk.java.net/jeps/302 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.
- virtualwhys 8y agoScala overloads underscore in various ways, my favorite being: 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.
- DeonPenny 8y agoMan at this point there is 0 reason not to use kotlin
- hello_moto 8y agoWhy not just go ahead and use Kotlin? What's stopping you?
- chvid 8y agoI had to look twice at your statement. 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?
- DeonPenny 8y agoBecause a lot of these features are already implemented in kotlin. They are written way more concisely with way less ceremony and boilerplate. Plus with kotlins interop you can piecemeal your codebase away from legacy java no matter the version. It's just a better language at this point
- ppeetteerr 8y agoThe use of `var` is a great improvement over the current method of declaring variables. I love Swift for many reasons (optionals, structs/objs, succinctness, no GC, etc.) and var-style declarations is one of them.
- scarface74 8y agoI thought the whole .Net Framework/.Net Core/.Net Standard distinction was crazy. But the more I read about the Oracle JDK vs OpenJDK and the difference in the support schedule and licensing, I find that Microsoft's strategy is much more understandable. 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?
- Larrikin 8y agoThe Android ecosystem is slowing down rapidly in new Java code and is moving as fast as it can toward Kotlin.
- chvid 8y agoI think what Oracle is doing wrt. LTS is actually quite reasonable. 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.
- yxhuvud 8y agoWhat? Ubuntu has a Year.month versioning scheme. Nothing like that seems to be going on here.
- chvid 8y agoHah. Sorry that is correct. They do have the same LTS, update, update, LTS, update, update thing going on as far as I can see.
- kasperni 8y agoThey are using the same versioning scheme (semantic versioning) as they have always done. 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.
- kjeetgill 8y agoAdopting Ubuntu-like date versioning was one proposal but not the one they ultimately went with. They instead went with a major version for every release like Chrome or Firefox. I think moving to a time based release was a good move but a major version per LTS might have reduced a lot of the apprehension around it.
- kasperni 8y agoI really do not understand why this is getting so much hate? I really think this new time based release versioning is much preferred to alternatives. 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.
- cstejerean 8y agoExcept you are essentially being forced since the previous version becomes immediately unsupported. By the time you consider and work through all the implications of upgrading to Java 10 it will be September and Java 11 will have come out, and Java 10 will be obsolete and unsupported. That’s a bit crazy for a major version that just came out in March.
- krzyk 8y agoYou can start testing new release before it is out. E.g. for 11, you get final RC at 8/30, and the release is on 9/25. Which means that you get almost a month while you can be 99% sure that you are testing with the target JDK. 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).
- avodonosov 8y agoProject Loom isn't mentioned. So proper continuations aren't close?
- karianna 8y agoFor those concerned about being forced to use Oracle’s JDK / support you can definitely just use OpenJDK now. The build farm we have put together at AdoptOpenJDK.net will produce professionally tested OpenJDK binaries for all major versions and platforms with free LTS support. You can then also always go to a commercial vendor like Oracle for extra paid support if that’s what your org needs.