Triple-strings

# Dmitry A. Soshnikov (14 years ago)

On 24.08.2011 20:19, Brendan Eich wrote:

On Aug 24, 2011, at 2:44 AM, Dmitry A. Soshnikov wrote:

Hi again,

And another topic which I'd like to separate from the doc-comments topic is the "triple-strings". The rationale is not to escape the double/single quotes when describing something bigger than one line (usually these are comments, but other simple strings with many of double quotes are also the case). We had a triple-quoted string proposal for ES4. That was long ago.

proposals:triple_quotes

Ah, didn't know, thanks.

The answer now is quasi-literals:

harmony:quasis

Yes, I'm aware about quasis, but seems inattentively considered all the cases.

No need to stutter " three times -- just use `. Did you miss this one?

Yes, definitely. Thanks for mention.

OK, then the topic with """ is obsolete.

Dmitry.

# Dmitry A. Soshnikov (14 years ago)

And another topic which I'd like to separate from the doc-comments topic is the "triple-strings". The rationale is not to escape the double/single quotes when describing something bigger than one line (usually these are comments, but other simple strings with many of double quotes are also the case).

var description = " This is "ECMAScipt", "The language of the 'Web' " ".

vs.

var description = ' This is "ECMAScript", "The language of the 'Web' " '

vs.

var description = """ This is "ECMAScript", "The language of the 'Web' " """

It also may continue to new lines without escaping and concatenation:

" This is "ECMAScipt"," + ""The language of the 'Web' " ".

vs.

""" This is "ECMAScript", "The language of the 'Web' """"

?

Dmitry.

# Brendan Eich (14 years ago)

On Aug 24, 2011, at 2:44 AM, Dmitry A. Soshnikov wrote:

Hi again,

And another topic which I'd like to separate from the doc-comments topic is the "triple-strings". The rationale is not to escape the double/single quotes when describing something bigger than one line (usually these are comments, but other simple strings with many of double quotes are also the case).

We had a triple-quoted string proposal for ES4. That was long ago.

proposals:triple_quotes

The answer now is quasi-literals:

harmony:quasis

No need to stutter " three times -- just use `. Did you miss this one? I need to talk it up more.