by _false · 5y ago · 0 comments
Could somebody please educate me on why bashing it would be preferable?
Bash is a much better glue language than python. If all your script does is to call other programs that do all the work, it is very likely you can write it as a single line shell script. In python, you'll have to import libraries, call functions with many arguments, and whatnot.
* Succinctness: When you mostly glue together other programs, Bash will often be shorter than Python.
* Familiarity/Ubiquity: If you're using a Unix-like you're already using Bash (probably; or another shell that's similar) as your main "REPL to the system". When you wanna automate a thing you can start off with what you've already been doing for that task and go from there. Similar story for experimenting when writing a script, though Python also has a REPL for that.
Bash is a prototype to the app in Python that is a prototype to the app in Golang.
The bash step is fast to write as it subsumes all the process calling / management.
JS (or python) is a reasonable next step, often just a tight cli wrapper around a function to be called in bash that is hard to write in bash / is from a library. I find its normally easier to pack JS dependencies for these one offs than python, but both work.
Next step is perf/testing focused. Js works as a great first step here as the Promises & event loop let you get a whole bunch of perf naturally that is a pita to arrange in python.
Now you have a program laid out and usage tested that can be re-written in something else for real or percieved benefits (go, bash, c++, rust)