RFR: JDK-8198986 - 3.10.7: Raw string literals

Tagir Valeev amaembo at gmail.com
Mon Mar 12 04:48:53 UTC 2018


Proposed spec changes look good and unambiguous to me, thanks. We should
not have any troubles implementing this in IntelliJ IDEA. After all we
already have raw strings support for Kotlin, Groovy, Scala and other

I personally still not very happy with the proposed syntax, but seems that
I failed to convince anybody in previous discussion [1], so probably I'm
wrong (or the world is not yet ready for such changes). To me, as an IDE
user, the problem of writing complex string literal is solved many years
ago: in IntelliJ IDEA you can edit the embedded code snippet in separate
editor view with all the bells and whistles like syntax highlighting,
quick-fixes and so on (you can assign the language of your choice to the
embedded code snippet), and IDEA will automatically add necessary escaping
or split with "...\n" + LF "...". You don't even concentrate on the escaped
string, you just switch to the separate editor and see it raw. Even less
sophisticated editors support paste inside string literal which will
perform necessary escaping. So I would instead concentrate on readability,
as people read code in much more places than write (e-mails, code review
tools, repository browsers, diff tools, StackOverflow). For me, ability to
paste the snippet as is in dumb editor should not be the priority feature.
But ok, I already expressed my thoughts and have nothing new to add for now.

With best regards,
Tagir Valeev.


On Thu, Mar 8, 2018 at 2:27 AM, Jim Laskey <james.laskey at oracle.com> wrote:

> JEP 326: Raw String Literals JDK-8196004 <https://bugs.openjdk.java.
> net/browse/JDK-8196004> has been approved as a JEP Candidate. I would
> like to propose this JEP to target sometime soon. Of course, there are many
> steps to getting there, including the review of the Java™ Language
> Specification.
> Please find a draft of the required  Java™ Language Specification changes
> at JDK-8198986 <https://bugs.openjdk.java.net/browse/JDK-8198986> for
> your review.
> Cheers,
> — Jim

More information about the amber-dev mailing list