JEP 430: String Templates Mandatory TemplateProcessor
Duncan MacGregor
duncan.macgregor at servicenow.com
Mon May 15 11:03:37 UTC 2023
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.
There is probably a usability question over whether a template fragment can itself include a string template with nested fragments, as my experience from the Ruby world is that although you can do it few things do correct syntax highlighting and thus it’s often very confusing to see in source code. I don’t think it’s normally a common pattern _except_ when some debugging or logging code ends up wrapping an expression.
Duncan.
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/749dfd5e/attachment.htm>
More information about the amber-dev
mailing list