Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FYI, CoffeeScript has multiline strings (and a bunch of other nice things!)


The next version of JavaScript does too: http://www.2ality.com/2011/09/quasi-literals.html


Sorry but what does this have to do with anything?


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?


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?


Coffeescript is just javascript with syntactic sugar on top. This library provides sugar for multiline strings.


To me, this library tastes more like too much salt.


I do. I love learning about closely related topics while reading the comments.


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?


Yes.


Well, no.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: