Even stripping trailing whitespace is... risky. Why is the language trying to decide what whitespace is significant? Or even trying to divine the mind of the developer at all?
I didn't realize there was a raw string proposal in Java 12 using backticks (bleh). By now I'm pretty used to languages that use double-quotes for interpreted strings (including escape sequences, at a minimum) and single-quotes for raw strings. This is an incredibly useful feature. Of course, Java uses single-quotes for character literals so that's out, otherwise I'd like to see """ for interpreted and ''' for raw.
Anyway, let me point out just one reason why this is terrible: source control. Consider:
String s1 = """
<outer>
<inner>foo</inner>
</outer>
"""";
Now change this to: String s1 = """
<outer>
<inner>foo</inner>
</outer>
"""";
It's only one line change but you have in fact changed what the previous lines do.And of course (which the article mentions).... tabs!
I really want the option of pasting text into a block like this and knowing that's what I'll get. I don't want to process it usually (eg escaping characters).