News for hackers. Stuff that matters.
Re:Multiline strings in JavaScript by adrusi on Saturday July 12, 2014 @06:42AM (#8024204)
When I was first really to program I was into hacking javascript to do the crazy things I wanted it to do. I basically did exactly this, albeit with a worse interpolation feature[1]. Don't actually do this please. In the browser, just open up a different <script type="text/plain"> and grab the string from that tag. On the server you can just use a file. Any string that's actually long enough for `["foo", "bar"].join("\n")` to be too cumbersome should be in a separate file, especially if the other way involves a massive hack.

[1]: http://zurb.com/forrst/posts/Javascript_native_multi_line_st...

Re:Multiline strings in JavaScript by jonpacker on Saturday July 12, 2014 @10:24AM (#8024603)
So you would suggest using external text files to store every SQL/Cypher query that is used in a model-based node app?
Re:Multiline strings in JavaScript by adrusi on Saturday July 12, 2014 @12:29PM (#8024968)
Well, if the query is longer than a 3-4 lines then it's really a program in its own right, and yes, I think it deserves its own file.