3 ms·
this is basically the midwit-meme in action: - uses: cat file.txt | grep foo # doesn't know why or that you don't have to - uses: grep foo file.txt # knows th
by fargle 3y ago
this is basically the midwit-meme in action:
- uses: cat file.txt | grep foo # doesn't know why or that you don't have to
- uses: grep foo file.txt # knows that's religiously the right way, knows maybe one or two options and that "cat" is bad.
- uses (when appropriate): cat file.txt # knows all the ways to do it, pros/cons of each, can make sound judgements and trades in real-time
all three groups are actually mostly doing nothing that wrong.
if someone or shellcheck points out "useless use of cat", and it's directed at the 1st or 2nd category it's helpful. it's either saying "was that a mistake?" or "did you know that you didn't have too...".
if someone points out "useless use of cat" just to be a pedant to throw rocks at an adult who knows full well what they are doing, not as helpful.
all that being said, if you are in that 3rd category, it's not just knowledge but maturity required not just personal preference alone. the author sure seemed to have a chip on their shoulder. i suspect the truth is somewhere in-between.