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

Cool hack but not supporting multiline strings is a feature as far as I'm concerned. Everyone seems to agree that HTML shouldn't contain JavaScript, why should JavaScript contain HTML?


That is actually currently being contested by React and .jsx.

That said, I've seen multiline abused for writing SQL queries as well, which would have been better off being written in a separate .SQL file and `fs.read` into a string with a descriptive var name. (Ignoring that massive SQL strings is a code smell imo).


Except if your application generates dynamic queries. And not of the sort where variables in the WHERE clause are dynamically evaluated. Of the sort where the entire structure of your SQL is dynamically driven by user interaction with your application.


Are you saying that large SQL strings isn't a code smell if the application is dynamically putting them together? That seems like DSL/Query Builder territory to me. Perhaps you could share an example?




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: