News for hackers. Stuff that matters.
Re:Multiline strings in JavaScript by tlrobinson on Saturday July 12, 2014 @07:14AM (#8024263)
FYI, CoffeeScript has multiline strings (and a bunch of other nice things!)
Re:Multiline strings in JavaScript by mofle on Saturday July 12, 2014 @07:46AM (#8024319)
The next version of JavaScript does too: http://www.2ality.com/2011/09/quasi-literals.html
Re:Multiline strings in JavaScript by mushishi on Saturday July 12, 2014 @07:34AM (#8024290)
Sorry but what does this have to do with anything?
Re:Multiline strings in JavaScript by tlrobinson on Saturday July 12, 2014 @07:45AM (#8024315)
If you want niceties like multiline strings, CoffeeScript is a better option than clever hacks like this.

    var str = multiline(function(){/*!@preserve
    multi
    line
    string
    */console.log});
Really?
Re:Multiline strings in JavaScript by mushishi on Saturday July 12, 2014 @09:21AM (#8024464)
Well, I don't get what is the point of suggesting alternative languages that have multiline strings when we are talking about one specific language.

The topic is about how to do multiline string in Javascript in one way, and one alternative is not to use multiline strings in Javascript. It's kinda big jump from the original purpose of the topic to start suggesting alternative languages... if we are to be this slack, then we can start spamming most threads with weakly related stuff. For example, you can easily advertise coffeescript in each and every javascript thread in a similar way you did in this specific thread but do we really need want that?

Re:Multiline strings in JavaScript by nottombrown on Saturday July 12, 2014 @12:04PM (#8024886)
Coffeescript is just javascript with syntactic sugar on top. This library provides sugar for multiline strings.
Re:Multiline strings in JavaScript by idlewan on Saturday July 12, 2014 @04:38PM (#8025719)
To me, this library tastes more like too much salt.
Re:Multiline strings in JavaScript by asdfologist on Saturday July 12, 2014 @09:40AM (#8024514)
I do. I love learning about closely related topics while reading the comments.
Re:Multiline strings in JavaScript by coldtea on Saturday July 12, 2014 @10:09AM (#8024579)
So, a transpiler, with new syntax, and its own set of BS issues, including an added step in your JS workflow (for the transpiling), is better than a small library doing exactly what you want?
Re:Multiline strings in JavaScript by applecore on Saturday July 12, 2014 @01:00PM (#8025061)
Yes.
Re:Multiline strings in JavaScript by coldtea on Saturday July 12, 2014 @01:27PM (#8025154)
Well, no.