Lots of shiny new toys to play with :) I like playing with new features and pushing to silly limits. Here's some fun things you can do now: Compiletime checked state machines with Sealed Classes [preview feature] https://benjiweber.co.uk/blog/2020/10/03/sealed-java-state-m... Autobuilders, Mixins, Conversions & more with Records https://benjiweber.co.uk/blog/2020/09/19/fun-with-java-recor... Pattern Matching fun http…
If you enjoy pattern matching in Java, I would recommend checking out the latest & greatest that C# has to offer as a comparison: https://docs.microsoft.com/en-us/dotnet/csharp/pattern-match... Being able to combine pattern matching with switch expressions has allowed us to construct extraordinarily concise state machines for our UIs.
Java 16
131–140 of 327 posts
Re: Java 16
#132Very cool to see that Scala continues to have a huge impact on Java’s roadmap. Records and Sealed Classes are borrowed from Scala. Could be not the best news for new Scala adoption, but good news for developers having better abstractions in Java Edit: Kotlin, and other languages should also mentioned since they also include similar features. I still think Scala has had the most influence over the years.
We see similar developments with C# borrowing features from F#, with records in v9, pattern matching, etc. While it's good for C#/Java, it does make it harder to push for adoption for a language such as Scala and F#. Why bother investing in the languages with a much smaller market share when the big boys adopt good bits and pieces from them constantly?
The C# versions of F# features tend to be pretty clunky compared to the F# versions. This is because F# was designed for them from the beginning, rather than having them tacked on. Functional programming is getting easier in C#, no question about that, but honestly, it still kind of sucks. And the OOP-minded C# devs on your team still won't be able to make sense of your code that leverages all these fancy new features anyway.
Re: Java 16
#133Earlier quoted context omitted.
Every thread about new Java version has the same comment all the time. Why share it? What kind of response do you seek?
I think it's interesting to discuss how many are stuck on java8. It was a long time many of us were stuck on java6 or 7, and finally got up to java8. But then when 9, 10 and 11 came no one made an effort to upgrade. Why? And now we're at 15 and people are starting to feel the heat. We only migrated our main service from 8 to 15 a month ago (AWS deprecation), but still have lots of 8 code laying around (luckily some o…
A lot of things broke in Java 9, which was short-lived (both it and Java 10 lasted only six months each), and then Java 11 broke many other things (for instance, it removed all of J2EE). As late as last year, I was still seeing changes in libraries to fix issues with Java 9 or later. It's not that no one made an effort to upgrade, it's that it was a lot of effort, and often required upgrading to later versions of libraries, which have their own breaking changes.
Re: Java 16
#134As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…
Re: Java 16
#135As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…
Java is portable BECAUSE of the JVM. If a new computer architecture hits the scene, once someone writes a JVM for it your .class files will run on it (probably).
Your C++ program, however, will definitely not run and you'll need to recompile it with a compiler that targets that new architecture.
The same compiled Java code will(should) run on a Mac or a PC or any Linux box, but you need a different executable for each target with a C++ program.
The JVM isn't portable. That needs to be recompiled for each new target, but your Java .class files are portable.
Re: Java 16
#136As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…
A huge majority of all code behind services, websites, and businesses you interact with every day. From Google, Facebook, Apple, and Twitter to your bank, and from Android to you favorite new unicorn. Of the top 25 unicorns "20 use Python; 19 use Java; eight use Kotlin. Coinbase was the only top-ten unicorn found to use Swift." [1]
And that's just startups and FAANG. On top of that, every enterprise, government organization, and financial organization also uses tons of Java with the exception of Microsoft shops, which use C# in its place (or also use C# on top of Java).
Think of it this way: you know how C# is a big industry? It's #5 in the TIOBE index. Java is #2, and has been between bouncing between #1, #2, and #3 spots for decades.
And on top of Java there's the JVM, which also powers Kotlin, Clojure, Scala, Groovy, and other languages...
>Java applets are dead
Java applets have been dead on arrival. It was just a fan around 1997-1999 and not that succesful even then (I was there). They were never a big part of Java's allure.
>Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run.
That's a non-sequitur.
[1] https://insights.dice.com/2019/07/12/python-java-kotlin-skil...
Re: Java 16
#137Still on Java 8 at work :-/
Re: Java 16
#138Looks like they added sensible no-boilerplate immutable data objects, and are trying to unbox their boxed primitives, yay for common sense at long last. While they're about it, they should also add immutable/copying data structures.
>While they're about it, they should also add immutable/copying data structures. They will start with records[1], but I think all value classes (Valhalla) should have this functionality eventually. You will be able to write: record Point(int x, int y){} Point pp = p with { x = 3; } [1] https://github.com/openjdk/amber-docs/blob/master/eg-drafts/...
Re: Java 16
#139The language is getting fragmented: value-based classes, records. I wish the features were introduced still keeping one kind of objects, instead of splitting the universe into 3 kinds of objects (usual objects, value-based objects, records). The feature I am awaiting most is the Project Loom.
Re: Java 16
#140As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…
I work on the trading floor of an investment bank in Hong Kong. Our OMS is made entirely in low latency Java (no GC, lots of perf test, few C++ binding when really we must). Java allows us, contrary to our poor colleagues in algo still on C++ to work in team, manage dependency, use really good tooling, unit test easily, have libraries that work consistently all across the universe (that's a beef I have with Python: e…
Please don't use Autism as an insult. It's exceptionally degrading to conversation here and presents no value; it does nothing other than cast you in a negative light.
I'll ~delete~ edit my comment if you edit the remark out, provided you do so before my ~delete~ edit threshold expires.
Edit: delete threshold expired. Can only edit, and won't be able to edit once the edit threshold expires.