Remarks on JEP 430

Cay Horstmann cay.horstmann at gmail.com
Sun May 7 09:19:36 UTC 2023


Here are some remarks on JEP 430, collected from discussions at the JAlba unconference.

* The interface name java.lang.StringTemplate was strongly felt to be confusing. An instance neither processes nor produces Strings. Suggestion: java.lang.Template, matching the grammar.

* Given that several programming languages use the syntax processor"..." without a dot, it would be helpful to have a rationale for the dot following the template processor. The parenthetical "as seen in other kinds of expressions" is not helpful. Obviously, in other kinds of expressions, the dot is followed by field or method names, which are not at all the same thing. Suggestion: Give a more cogent rationale, or drop the dot

* The RAW processor will confuse JavaScript and Scala programmers. Suggestion: TEMPLATE

* Suggestion: Change the heading "String interpolation is dangerous" to "String interpolation can be dangerous", and "Interpolation is especially dangerous for SQL statements" to "Interpolation is dangerous for SQL statements"

* The section "User-defined template processors" gives a rationale why STR is written in uppercase. That rationale does not hold for the processors named INTER, INTERN, JSON, DB, THAI, LOCALIZE below. Suggestion: Write those in lowercase, or declare them as final.

* The example of the INTER processor with placeHolder "•" is obviously dangerous and adds no real value. Suggestion: Drop it and start with the subsequent example.

Cheers,

Cay

--

Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com


More information about the amber-spec-observers mailing list