Hacker News new | ask | show | jobs
by furyofantares 1195 days ago
> shell scripts are very easy to write

I've been a developer for a long-ass time, though I don't have super frequent occasion where I find it worthwhile to write a shell script. It comes up occasionally.

In the past 2 weeks I've "written" 4 of them via ChatGPT for 1-off cases I'd have definitely found easier to just perform manually. It's been incredible how much easier it was to just get a working script from a description of the workflow I want.

Usually I'd need to double check some basic things just for the scaffolding, and then, maybe double check some sed parameters too, and in one of these cases look up a whole bunch of stuff for ImageMagick parameters.

Instead I just had a working thing almost instantly. I'm not always on the same type of system either, on my mac I asked for a zsh script but on my windows machine I asked for a powershell script (with which I'd had almost no familiarity). Actually I asked for a batch file first, which worked but I realized I might want to use the script again and I found it rather ugly to read, so I had it do it again as a powershell script which I now have saved.

Sure though, someone won't tell an LLM to write a shell script that just calls a python script. They'd have it make the python script.

2 comments

I think one effect of LLMs and their limited context will be the end of DRY. I’ve already found myself getting gpt to write stuff for me that could have been part of or leveraged existing code with a little more thinking. But the barrier to just starting from scratch to do exactly what I want, right now, just got a whole lot lower.
Why, given the power and flexibility of ChatGPT, would anyone in their right mind ask it to write a shell script instead of a Python script?

Whose time and effort do they think they're saving by bringing more shell scripts into existence, anyway?

Shell scripts are objectively and vastly worse than equivalent Python scripts along all dimensions.

It's like having a food replicator from Star Trek: TNG, and asking it to make you rancid dog food instead of lobster.

I threw most of these scripts away after using them once, plus it was under a minute to get them working, so maybe I'll try a python script next time.