News for hackers. Stuff that matters.
Re:Shshsh is a bridge connects Python and shell by bsimpson on Saturday September 23, 2023 @03:03PM (#37626321)
Also, `>> 'some-cmd --with --args'` is code that's more likely to end up in a deployment script than in a production app. Less likely to be a project that's being edited by many people at once, served to end users, etc.

I respect and often agree with the parent's hesitation to introduce inessential dependencies, but the cost/benefit of making a shell script more comfortable to read/write is very different than that of adding a mystery brick to the foundation of your app.

Re:Shshsh is a bridge connects Python and shell by nrclark on Sunday September 24, 2023 @07:28AM (#37632132)
Deployment scripts are production code, same as whatever you're deploying. If your CI/CD docker images break, you're just as stuck as if your payload breaks.

I totally see the benefit of moving complex shell logic to Python (and still calling some shell helpers) but that doesn't mean you need to have a whole extra dependency for it.

You could write a one-line function that wraps subprocess.Popen.communicate, and use it instead for 90% of the benefit.

If the argument is "I don't want to learn it", or "too much effort", then I'd ask - is saving 15 minutes one time during development really worth a permanent dependency?

And when some other dev has to maintain the code later, how much extra time will they spend figuring out what I>> means or does? A lot of python devs are already familiar with the subprocess Popen API.