<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4" face="monospace">The following was received on
amber-spec-comments. <br>
<br>
The opinion expressed here (which can be paraphrased as "why don't
you just do string interpolation, it's safe and simple") is a
familiar one, and one which has been discussed over and over. The
belief that there are "no security concerns" with string
interpolation is incorrect, and "just do string interpolation"
remains an anti-goal. <br>
<br>
The author here might be correct that the intersection of
"acceptably secure" and "acceptably complex" is empty; in this
case we will do nothing. But we are continuing to explore this
space to find something that balances all the concerns. <br>
<br>
<br>
</font>
<div class="moz-forward-container"><br>
<br>
-------- Forwarded Message --------
<table cellpadding="0" cellspacing="0" border="0" class="moz-email-headers-table">
<tbody>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">Subject:
</th>
<td>String templates - JEP-459, JEP-465</td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">Date: </th>
<td>Sun, 22 Dec 2024 01:27:16 +0100</td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">From: </th>
<td>Mariusz Lotko <a class="moz-txt-link-rfc2396E" href="mailto:mariusz.lotko@gmail.com"><mariusz.lotko@gmail.com></a></td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:amber-spec-comments@openjdk.java.net">amber-spec-comments@openjdk.java.net</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<p>Good evening,<br>
</p>
<p>I read all three JEPs of String Templates and I'm a bit
surprised that we need such a complicated feature.</p>
<p>I bet that most Java developers simply <u>expects</u> simple
string interpolation, that they will be able to replace
not-quite-readable string concatenations like:</p>
<p><br>
</p>
<p> "This is " + some.strange().callsWith("an argument") + "
the end"</p>
<p><br>
</p>
<p>with something like (I like JS version the most)</p>
<p><br>
</p>
<p> `This is ${some.strange().callsWith("an argument")} the
end`</p>
<p><br>
</p>
<p>or</p>
<p> ```</p>
<p> This is the multilne version</p>
<p> ${some.strange().callsWith("an argument")}</p>
<p> the multiline end</p>
<p> ```</p>
<p><br>
</p>
<p>At compiler level that would be "simply" replace to old-good
contatenation implementation which is StringBuilder calls.</p>
<p>No security concerns (other than with current + operator), no
(hidden) runtime penalties like the proposed FMT feature has to
introduce.</p>
<p>"String Templates" as language feature opened for externding by
the libraries seem to me quite complicated. The benefit that we
provide templates built into the language does not seem to be
attractive - why should I use built-in templates instead of 3rd
party Velocity/JTwig/whatever else? <br>
</p>
<p>Best regards,</p>
<p>Mariusz Lotko<br>
</p>
</div>
</body>
</html>