3 ms·
It seems strange to embed content in code in this way. You lose syntax formatting if it's structured content (HTML, JSON, etc) and also require recompiling if t
by bathtub365 6y ago
It seems strange to embed content in code in this way. You lose syntax formatting if it's structured content (HTML, JSON, etc) and also require recompiling if the content changes. I understand doing it if you're prototyping/hacking things together but it seems like a lot of effort was put into building this feature.
- enitihas 6y agoIf you use a good IDE like IntelliJ, you don't lose syntax formatting, and can edit the fragment even with autocompletion. IntelliJ is good enough to do this even right now without text blocks in Java, when let's say a HTML snippet is constructed using string concat.
- masklinn 6y agoIt's extremely convenient to embed content which is not single line but which you'd be embedding either way e.g. text with some amont of formatting, or literal SQL queries. It's also useful for small amounts of structured content e.g. if you don't yet need to rely on a full-blown templating system for your HTML, or to POST small amounts of static JSON or somesuch. > You lose syntax formatting if it's structured content Jetbrains's IDEs do content-sniffing and formatting and coloration of embedded content (though it breaks down somewhat quickly if you start doing string formatting within the block).
- stickfigure 6y agoIntelliJ not only handles syntax formatting of code in string literals, but validates SQL against the db schema and performs identifier completion. It's more convenient and safer to put SQL (or other text) inline next to the code that uses it rather than "some other file" that can fall out of sync.
- bathtub365 6y agoI guess I don’t have this problem because I don’t work on CRUD apps.