4 ms·
It takes a while, like anything, to get comfortable with shell scripts, but it's absolutely a tool that every programmer should have basic familiarity with. It'
by wool_gather 8y ago
It takes a while, like anything, to get comfortable with shell scripts, but it's absolutely a tool that every programmer should have basic familiarity with. It's universal glue.
And in the domains where shell is a good choice, it's a far far better choice than Swift. Maybe that will change, but I doubt it.
I've implemented a couple of medium-small tools over the last two years and as an exercise did them in both shell and Swift. The shell versions are simpler, more maintainable, and more robust than the Swift versions. Swift's verbose "correctness" is not an asset in the domain(s) where scripting is useful. Gluing programs together is one. Frankly, text processing is another. An invocation of sed with a simple regex becomes a monstrosity when translated to Swift. The less code you write, the less you have to maintain.
- saagarjha 8y ago> An invocation of sed with a simple regex becomes a monstrosity when translated to Swift. This is because Swift’s regex support is overly verbose, being lifted straight from Objective-C. It’s not an inherent problem when the language.
- bexsella 8y agoAgreed, along with basic familiarity with vi/vim this is almost required knowledge if you're deploying to or working on a system other than Windows or MacOS.
- wool_gather 8y agoIt definitely applies to Mac as well; it's got a full complement of BSD command line goodies.