I decided to skeptically play with Claude Code recently.
-
@recursive
Your finding is that we should just give up on writing shell scripts because the code generator is bad at it?@EndlessMason No, because everyone is bad at it. This was a bit of bash that made sense to an experienced shell script dev. In fact it worked for him because he was using bash 3 (MacOS default), and failed for me using bash 5.x (from nixpkgs). And further the documentation of these kinds of changes in bash is pretty iffy. Shell script compatibility is an extremely vague contract across the sands of time.
What the code generator did for me is better characterize what it would take to usefully check for this in shellcheck and find some relevant past issues. What it fails at is being unable to say "you idiot, stop writing bash", but it sure does sling some text around fast.
See my standards are such that if I were to actually submit this candidate PR I had it make, I would have to feel able to defend the 90 lines of dubious Haskell it wrote vis-a-vis existing issues and I'm just not convinced that would be useful, it's given me some insight into the complexity of what shellcheck attempts to solve (arguably not a problem we should be solving)
-
@EndlessMason No, because everyone is bad at it. This was a bit of bash that made sense to an experienced shell script dev. In fact it worked for him because he was using bash 3 (MacOS default), and failed for me using bash 5.x (from nixpkgs). And further the documentation of these kinds of changes in bash is pretty iffy. Shell script compatibility is an extremely vague contract across the sands of time.
What the code generator did for me is better characterize what it would take to usefully check for this in shellcheck and find some relevant past issues. What it fails at is being unable to say "you idiot, stop writing bash", but it sure does sling some text around fast.
See my standards are such that if I were to actually submit this candidate PR I had it make, I would have to feel able to defend the 90 lines of dubious Haskell it wrote vis-a-vis existing issues and I'm just not convinced that would be useful, it's given me some insight into the complexity of what shellcheck attempts to solve (arguably not a problem we should be solving)
@EndlessMason I saw shellcheck catching on starting about 10 years ago and honestly feel like it's made people a bit complacent
-
This is useful
But I'm not sure if enough engineers would embark on this and conclude, "no, we need less code, fuck this" when given a code-generating tool
"Write more code" is just a terrible incentive structure
-
"Write more code" is just a terrible incentive structure
@recursive despise it. delete more code. That’s the key to success.
-
"Write more code" is just a terrible incentive structure
I still have extremely mixed feelings about these tools, but a friend actually convinced me that they can be useful sometimes
I worry most about imposing cognitive load through shitloads of code to review
Well that and management misunderstanding of the whole mess leading us to unmaintainability
-
I decided to skeptically play with Claude Code recently. I'm not especially impressed though it did help a bit to dig into an issue
However instead of submitting a significant PR to shellcheck (which would require me spending a lot of time understanding it to really ethically justify doing so), I have instead concluded that we shouldn't extend the lifespan of Bourne-shell languages with shellcheck. As the quote goes, "Never wrestle with a pig: You both get dirty, and the pig likes it."
Shell scripting is the pig.
@recursive
Boo, hiss!
You can take my shell scripts from my cold dead hands!
...
Yes I know I should just do shit in python or whatever, but a simple shell script to do a little curl, jq, grep, sed, etc. without having to faf around with actual code
-
@recursive
Boo, hiss!
You can take my shell scripts from my cold dead hands!
...
Yes I know I should just do shit in python or whatever, but a simple shell script to do a little curl, jq, grep, sed, etc. without having to faf around with actual code
@JessTheUnstill IME the problem is that other languages tend to fail at the expressivity we are accustomed to in shell script. They make "run a command" a big deal and they don't give good syntactic sugar around it
And a lot of them are languages which are historically loathe to introduce clever syntax (e.g. python)
-
I still have extremely mixed feelings about these tools, but a friend actually convinced me that they can be useful sometimes
I worry most about imposing cognitive load through shitloads of code to review
Well that and management misunderstanding of the whole mess leading us to unmaintainability
@recursive I was talking with a colleague about AI over the weekend. Mentioned that some developers started sending in a lot more code to review. And they buffered that by having AI do the initial PRs. Kind of like an advanced linter. Took some of his back and forth out of the loop. Because the the AI based engineers could get AI feedback on their AI code. Then when that was all polished up you can bring it to the senior human.
-
I still have extremely mixed feelings about these tools, but a friend actually convinced me that they can be useful sometimes
I worry most about imposing cognitive load through shitloads of code to review
Well that and management misunderstanding of the whole mess leading us to unmaintainability
@recursive reframe their use as "how can I use this tool to assist me create higher quality software. Some of it might be writing the code with the LLM, to me it's more about building tools to reduce cognitive load (thus allowing more cognition to be focused on the real issues), and being able to iterate on many prototypes / try out many different things quickly, code which will not make it into production or is even supposed to survive for very long, in order to map out the design space which will allow "simple" (as in Simplicity with a capital S) solutions to be found.
One of my favourite prompts which costs almost nothing: "design an elegant API to do X" (plug in your problem, point at your existing codebase, etc...), and then go "oh yeah that's pretty neat, build" or "nah i don't like that, do it more like Y". In the worst case you'll build the API implementation yourself, but by virtue of being LLM generated, the API is usually pretty consistent, non-surprising, using well-known patterns.
-
@JessTheUnstill IME the problem is that other languages tend to fail at the expressivity we are accustomed to in shell script. They make "run a command" a big deal and they don't give good syntactic sugar around it
And a lot of them are languages which are historically loathe to introduce clever syntax (e.g. python)
@recursive I got good at shell back in my Linux Admin days where who knew what tools might be on any given node, and they didn't have internet connections to pull down dependencies. Hell, plenty didn't even have python installed. So it's a lot of living off the land knowledge I got used to.
-
@JessTheUnstill IME the problem is that other languages tend to fail at the expressivity we are accustomed to in shell script. They make "run a command" a big deal and they don't give good syntactic sugar around it
And a lot of them are languages which are historically loathe to introduce clever syntax (e.g. python)
@recursive command line and file operations are also just way more headaches than they're worth. I'm sure if I did it enough I'd memorize their syntax, but even all these years later, still nobody can keep up with the speed of
grep. It's a magic program. -
R relay@relay.infosec.exchange shared this topic