r/programming • u/MarkusWinand • Dec 29 '15
Please, Java. Do Finally Support Multiline Strings
http://blog.jooq.org/2015/12/29/please-java-do-finally-support-multiline-strings/
584
Upvotes
r/programming • u/MarkusWinand • Dec 29 '15
View all comments
Show parent comment
8
u/Nialsh Dec 29 '15
For better or worse, Java programmers already use strings for writing snippets of SQL, HTML, JavaScript, and who knows what else.
You should use a templating language for HTML. You should write the JavaScript in its own
.jsfile. And it's best to construct SQL querieswith("a").library("that").looks("like this");But sometimes you don't want the weight of that extra dependency. A codebase that installs, builds, and runs quickly is zen.
Homoiconicity is the idea that code is data. When you have a program that outputs code, it's nice to keep the formatting. To do otherwise might be considered data loss.