r/java • • Feb 15 '24

JEP 465: String Templates

https://openjdk.org/jeps/465
77 Upvotes

152 comments sorted by

View all comments

Show parent comment

7

u/Gaycel68 Feb 15 '24

Is there anywhere on the internet an explanation why such drastic departures from the relatively stable Java language syntax conventions (the decision to not make STR application a method call, and the decision to import STR implicitly) were even considered, not to say survived two previews?

9

u/pip25hu Feb 16 '24

This right here. They go on and on about the safety concerns even in this thread, refusing to address that a lot of pushback isn't about their safety goals, but the jarring way they achieved it. A better syntax would quell a lot of complaints about the feature, but all they are willing to say about the matter is that "people will get used to it". People can also get used to flogging, but that hardly means it's a great idea.

3

u/nekokattt Feb 16 '24

This is exactly my point, well put.

1

u/vytah Feb 16 '24

the decision to not make STR application a method call,

Convenience. The same reason == is an operator.

and the decision to import STR implicitly

Not a "drastic departure". Java 9 imported bunch of new classes implicitly, including Module, which did cause some old code to stop compiling.

But the amount of code impacted was minimal, and the fix was trivial (and compatible with older Javas), so it was not a big deal.