This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.
Java 18 / JDK 18: General Availability
141–150 of 304 posts
Re: Java 18 / JDK 18: General Availability
#142Here's the openjdk page which includes links to details of all new features: https://openjdk.java.net/projects/jdk/18/
This one looks interesting: "JEP 400: UTF-8 by Default": https://openjdk.java.net/jeps/400 It sounds like a good idea, but I can imagine lots of downstream breakage, some of it not immediately obvious, with apps that make bad assumptions. Edit: The risks section of the linked doc above does explain some of that, and there is some notable risk.
Re: Java 18 / JDK 18: General Availability
#143It's legitimately fascinating to see the rise of pattern matching, to the point that even Java will have it [1]! Combined with lambdas, this is a different language than the Java 1.5 that I first learned. If you would have told me that this would be valid Java code: static void testStringOrNull(Object o) { switch (o) { case null, String s -> System.out.println("String: " + s); } } I would never have believed you. And…
Re: Java 18 / JDK 18: General Availability
#144IntelliJ is yet to catchup it seems https://www.jetbrains.com/help/idea/supported-java-versions....
Re: Java 18 / JDK 18: General Availability
#145Is there a reason to use Oracle's closed-source Java implementation instead of the opensource implementations? Asking as someone who's ignorant about Java. edit: per comments below, Oracle's Java is open-source too these days.
Re: Java 18 / JDK 18: General Availability
#146It's legitimately fascinating to see the rise of pattern matching, to the point that even Java will have it [1]! Combined with lambdas, this is a different language than the Java 1.5 that I first learned. If you would have told me that this would be valid Java code: static void testStringOrNull(Object o) { switch (o) { case null, String s -> System.out.println("String: " + s); } } I would never have believed you. And…
[deleted]
Re: Java 18 / JDK 18: General Availability
#147Earlier quoted context omitted.
> Java values backwards compatibility very highly, so if something runs today, it's likely to keep running without modification on future JVMs. Then why do I have to have multiple JVMs installed, which I need to go through via trial-and-error, if I'm given some random java application?
> Then why do I have to have multiple JVMs installed, which I need to go through via trial-and-error, if I'm given some random java application? You don't. Almost any Java program written ever will run on Java 18.
This is just how things are. It's Java fanfiction to say this isn't the case, and necessitates having multiple JVMs installed.
Re: Java 18 / JDK 18: General Availability
#148Earlier quoted context omitted.
Some people like support contracts. It gives you someone to blame when the auditors come knocking.
But does anyone like being involved with Oracle? There are other java vendors that offer support.
I think it'll be very atypical for a companies who doesn't use any of the Oracle product to use proprietary Oracle Java and pay for the support
Re: Java 18 / JDK 18: General Availability
#149Earlier quoted context omitted.
Just because something is a well known-flaw doesn't make it a glaring flaw. There's a reason newer JVM languages like Kotlin use == as an alias for equals instead of reference equality.
What if you are interested in reference equality?
Sometimes, it happens in core Java libraries themselves: https://bugs.openjdk.java.net/browse/JDK-8274779
https://github.com/openjdk/jdk/blob/722d639fad2e4fc6eb2aabd4...
Re: Java 18 / JDK 18: General Availability
#150>JEP400: UTF-8 by Default This changes the default charset of the Java APIs to UTF-8. I read that the Java 8's JVM's internal string representation is UTF-16 [0][1]. Is that still the case after JEP400? [0] https://docs.oracle.com/javase/8/docs/technotes/guides/intl/... [1] http://tutorials.jenkov.com/java/strings.html
Since Java 9/11 (9 is not a LTS), String internals was reworked to use either 8 bits or 16 bits per char. [1] [1] https://openjdk.java.net/jeps/254