4 ms·
Clarity is more important but so is scope, I think. If the script is trying to do programming language stuff (data structures, complex computation -- as opposed
by shrimp_emoji 2y ago
Clarity is more important but so is scope, I think. If the script is trying to do programming language stuff (data structures, complex computation -- as opposed to just calling commands on files) in a command language (like Bash), that's bad. Use a programming language, like Python.
If it's a complex program, switch from a scripting language to a compiled language (since compilers give you static type checking, which is useful in large programs).
- JohnFen 2y ago> Clarity is more important but so is scope, I think. Scope is important, yes. My point was really just that very large shell scripts can be done in a way that isn't a nightmare. I agree that if you're doing more complex stuff such as data structures and the like, using a programming language should be the default position. In this particular case, it was not possible to use Python as that doesn't exist on most the platforms that we needed to support. Using a compiled language was possible, but not desirable, as it would have greatly complicated everything. A shell script really was the least-bad option. Once the shell script was done doing its thing, the actual application was compiled (by the script), though. The script wasn't doing the main business logic, only installation and configuration.