11 ms·
I can't say I'm completely on top of the Java world, but I think the String Templates are one of the very few preview features that have been actually withdrawn
by whartung 2y ago
I can't say I'm completely on top of the Java world, but I think the String Templates are one of the very few preview features that have been actually withdrawn and removed, right? Are there others?
I know some drift a bit on their implementations over time, but have not be wholesale yanked out.
Obviously the solution to this is to not rely on these preview functions for production code. The way to do that is to run production in an LTS version of Java. I don't think that's an extreme point of view, frankly.
The new stuff is interesting and cool, and in time, it ends up in the LTS version.
Having lived through Java 5, 6, and 8, these are halcyon times for Java. It's moving VERY fast, and has been for some time.
Are there preview capabilities in the LTS versions? Yes, there are. But they're not under the LTS tent. Don't use them. The demarcation between the development releases and the LTS releases are a smart program to get features out into the world, and set some real lines in the sand for advancement. It helps keep preview items from staying in preview mode for an indeterminate amount of time.
And the two year LTS release cycle for a notoriously conservative eco-system is ample.
- topspin 2y ago> Are there others? String Literals (JEP 326) made it to preview and got pulled. > I don't think that's an extreme point of view, frankly. Can't see where I suggested otherwise. I just wondered how the author was handling all the "in-flight" (An OpenJDK term there, not mine) features that Java currently has outstanding. > It's moving VERY fast, and has been for some time. They've been fast at creating new preview features. Actually landing finalized features though? In my view they're taking too long. When I compare Java and Python in this respect -- and I do as a working programmer in both on a frequent basis -- Java is still slow.
- perrylaj 2y ago> When I compare Java and Python in this respect -- and I do as a working programmer in both on a frequent basis -- Java is still slow. I feel this as well, but I also think it's desirable. Java is slower to add features because the bar is quite a bit higher (especially with regard to backwards-compatibility). I'd much rather have long previews and occasional removal of previews than have a language that becomes bloated and kneecapped by past rushed decisions. There's Kotlin, Scala, Groovy, etc, if you want to run on the JVM with languages that offer more features (and footguns). I find the balance OK, personally. I'd much rather them pull the `STR.` templates than push it forward knowing its not ergonomic in practice.
- kaba0 2y agoString Literals have been superseded by Text Blocks though, so it’s only “got pulled” as a technicality, Text Blocks are stable parts of the language now forever. I believe something similar will happen with string templates. Also, Java has gotten an insane number of new, significant features in the last couple of years — loom, algebraic data types, pattern matching, ZGC.. I don’t want to disrespect Python, but I really don’t think they have done anything to this degree.
- vips7L 2y agoUnfortunately I think we're currently in a state where all resources are going towards project Valhalla. Everything seems to be on hold until they get that out the door.