|
|
|
|
|
by gorgoiler
635 days ago
|
|
That looks like a snippet from a command session which is a perfectly great place to be using sh syntax. If it became unwieldy you’d turn it into a script: #!/bin/sh
beautify() {
sed -e ‘
s/ugly/beautiful/g
…other stuff
‘
}
select() {
awk ‘
{print $2, $4}
…other stuff
‘
}
mycommand | beautify | select
For me, now it’s starting to look like it could be safer to do these things in a real language. |
|
For me, the "line in the sand" is not so much whether something is "safer" in a different language. I often find this to be a bit of a straw-man that stands in for skill issues - though I won't argue that shell does have a deceptively higher barrier to entry. For me, it is whether or not I find myself wanting to write a more robust test suite, since that might be easier to accomplish with Ginkgo or pytest or `#include <yourFavorateTestLibrary.h>`.