multiline string/string literal without escape processing
saeedtej at yahoo.com
Sun Aug 21 03:48:36 PDT 2011
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.
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