[swift-evolution] [Review] SE-0168: Multi-Line String Literals

Brent Royal-Gordon brent at architechies.com
Mon Apr 10 01:24:42 CDT 2017


Sorry, I realized I had a little more to say about this.

> On Apr 9, 2017, at 8:46 PM, FĂ©lix Cloutier <felixcca at yahoo.ca> wrote:
> 
> C# was able to eliminate the whole class of SQL injections by introducing a convenient and powerful syntax for queries that is not string-based. I think that Swift should be moving in that direction, especially since no one has made any other case for long strings so far.

LINQ is, by all accounts, a pretty nice feature. It also seems to have taken at least five years to develop. We cannot realistically hope to put that kind of effort into a beautifully crafted, language-integrated solution to every problem that a Swift developer could solve with a five-line string literal, particularly when many will be highly domain-specific: generating config files or source code, communicating with a half-dozen NoSQL databases with disparate query languages and capabilities, even just writing tests that check the output of systems designed to do these things. And even if you somehow designed elaborate features to handle all of those, or were willing to insist that developers should design elaborate subsystems to handle them, there's still the cases where you're just flat-out generating large chunks of text to show to human beings.

Multiline string literals are a basic tool with vast and diverse uses. Even if some individual use case might be better addressed by a bespoke feature, it is well worth it to build a tool so simple, versatile, and easy to add.

-- 
Brent Royal-Gordon
Architechies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170409/3ba9f985/attachment.html>


More information about the swift-evolution mailing list