TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Java: Update on String Templates (JEP 459)

4 点作者 lichtenberger大约 1 年前

1 comment

exabrial大约 1 年前
I don’t want to piss on anyone’s hard work… I just do not like the proposed syntax for string templates.<p>STR.” doesn’t make sense. STR looks like a constant. . Looks like a function call or field access, and “ shouldn’t follow period. Recycling these characters is just hard to grok.<p>And the API just leaves too much of the language to upend imho. There’s a reason why Java doesn’t do things like operator overloading… it’s a cool party trick but in the long run it does more harm than good on codebases you werent the sole author on.<p>How about a new string delineator and use the \{brace} format and we call it good? Super easy and IDE support would be a snap too.<p>I just feel they’re reaching for too much. But i DO appreciate they’re taking their time. Java is one of the last bastions where people are doing real effort into maintaining backwards compatibility.