JEP 430: String Templates Mandatory TemplateProcessor

Remi Forax forax at univ-mlv.fr
Mon May 15 14:03:50 UTC 2023


> From: "Duncan MacGregor" <duncan.macgregor at servicenow.com>
> To: "amber-dev" <amber-dev at openjdk.org>
> Sent: Monday, May 15, 2023 1:03:37 PM
> Subject: Re: JEP 430: String Templates Mandatory TemplateProcessor

> I don’t understand the dislike for \{ either. Ruby uses #{, Swift uses \(,
> Python uses $, or { depending on whether you’re using f-strings, and so on. I
> use all of these at least semi-regularly and none of these is particularly ugly
> and all are abundantly clear if your IDE or editor supports correct syntax
> highlighting. I wouldn’t mind discussion of the syntax if it were more nuanced
> than “\{} 冷 ” (actual reddit comment), but I think until we see better
> arguments than, “Kotlin does it this way,” I’m not sure it’s valuable.

I've recently discussed with someone that choose to use ${} as a syntax for his template library. 
The given reason is that '$' is seen as a pseudo character, so it works well in strings that uses the usual delimiters like :, ;, / or \ because it visually keeps the structure. 

Now, Brian, the spec lead, said that the escape sequence is \{...} so it is. 
Let's wait and see at least until 21 is released, at that points more people will use the feature, so the feedback will be more based on actual users. 

> Duncan.

Rémi 

> From: amber-dev <amber-dev-retn at openjdk.org> on behalf of Jim Laskey
> <james.laskey at oracle.com>
> Date: Saturday, 13 May 2023 at 16:19
> To: interlink.sg7 at gmail.com <interlink.sg7 at gmail.com>
> Cc: amber-dev at openjdk.org <amber-dev at openjdk.org>
> Subject: Re: JEP 430: String Templates Mandatory TemplateProcessor
> [External Email]

>> Note that there is a very strong backlash against the backslash (play on words
>> intended) in the Java community.

> Depends on who you hang out with. I know the Swift crowd seem content with \(.
> Not sure I see the point of making all languages the same.

> Like any new language feature, you do get use to \{. Once IDEs integrate, string
> templates will become second nature.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230515/bfcfcab7/attachment-0001.htm>


More information about the amber-dev mailing list