multiline string/string literal without escape processing
forax at univ-mlv.fr
Sun Aug 21 07:45:58 PDT 2011
On 08/21/2011 12:48 PM, saeed yousefi wrote:
> Yes , I know I can put the text into external resources but it doesn't mean that there shouldn't be such facility in the language itself .
> so for what strings exist ? There are lots of places where I want to return a short JSON response from server and I can do it with this feature.
Why not using a lib for that ?
After all this is one of the great force of Java,
you want to do something in Java, there is an app lib for that.
> From: Tom Ball<tball at google.com>
> To: saeed yousefi<saeedtej at yahoo.com>
> Cc: "coin-dev at openjdk.java.net"<coin-dev at openjdk.java.net>
> Sent: Sunday, August 21, 2011 4:21 AM
> Subject: Re: multiline string/string literal without escape processing
> Another option is to put the text you're currently laboriously escaping into external resource files, and just read them in as needed. The advantage to keeping text in different files is that most editors and IDEs provide syntax-specific formatting, which makes it easier to write and mades errors easier to spot. JSON? Use a library to convert your data types instead of doing it by hand, as the overhead is minimal. Write unit tests for those data classes and you have a much more robust solution that scales much better than hand editing.
More information about the coin-dev