[swift-evolution] URL Literals
stephenherronbuck at icloud.com
Sat Dec 17 11:23:55 CST 2016
I like the David Sweeris idea best. The syntax is cleaner and the type URL "knows what to do with itself".
let url: URL = "https://example.com"
I have strong reservations about hard-coded URLs as an SDLC 🚂 wreck waiting to happen, but the world of mid-day build and deploy might mitigate this, except when the developers are laid off and an acquisition or service consolidation causes a domain or URL change. Having seen this many times I have always put URLs in a properties file for bootstrapping, and a database for post-bootstrap. This allows per-instance customization and live instance changes which is also usually necessary.
More information about the swift-evolution