I had some shell scripts littered with `|| true`, which was obviously obscuring real errors everywhere. When I challenged the model, it gave me the same "cargo-culting" answer.

The `|| true` is often done because people use `errexit` as part of "Bash strict mode"[1], which comes with so many caveats[2] that I usually avoid it. Claude, however, loves it.

[1]: http://redsymbol.net/articles/unofficial-bash-strict-mode/

[2]: https://mywiki.wooledge.org/BashPitfalls#set_-euo_pipefail

I use "strict mode" in almost every script I write. IMO these caveats shouldn't be a reason not to use it, but should instead be used as a manual of what to avoid when using it. This is just programming. Everything is a tradeoff.

`|| true` is a horrible practice because even though it may help in cases where a specific failure mode is acceptable, it obscures unexpected failures and could prove catastrophic. The solution is not to drop the protections but rather to handle the expected failure and let the sript crash otherwise.

This is, again, programming. You don't usually `catch Exception` in Python for similar reasons. There may be legitimate uses for that, but IME they are a rare exception and realistically only used when I actually don't care about what happens when I run it.

The other infuriating thing I found is that when I call out the model for its use of `|| true`, it tends to replace them with `|| echo "error foobar"` - which is at least not completely silent but the same problems exist.

From your statement and the parent comment, just learned that "cargo cult" is a thing, but cargo-culting as a compound is something AI has made up? [1].

As I was educating myself, I found Richard Feynman's Commencement Speech at Caltech in '74 [2] that might have coined this for our industry? If you would rather listen than read [3]. Posting this for others curious on the term.

1. https://trends.google.com/trends/explore?q=Cargo-culting&hl=...

2. https://calteches.library.caltech.edu/51/2/CargoCult.htm

3. https://www.youtube.com/watch?v=yvfAtIJbatg

Thanks for this! I confess I've heard of cargo culting for a long time but never thought too much of it. Seemed like an idiom like any other. The talk is fascinating, and describes attitudes I see all the time in the industry and at work, and they bother me. Now I know they are also cargo culting. That will hopefully help me steer people away from those practices.