4 ms·
As soon as I hit an “if” branch in a shell script I move to JS, Python or Ruby
by justsomeuser 5y ago
As soon as I hit an “if” branch in a shell script I move to JS, Python or Ruby
- dahfizz 5y agoDo you have node installed on all Linux boxes you interact with?
- justsomeuser 5y agoI typically deploy my code in docker containers. Often bash-like scripts are for my dev machine. But if portability was an issue I would still probably move to something that outputs a single binary (Go, Rust). I just think bash is not a very good language compared to the alternatives.
- dfinninger 5y agoI think if's are generally alright. My personal bar is arrays. Anything beyond for x in a b c; ... is getting written in Python.
- justsomeuser 5y agoIt's not the "if" in particular, it's more of a signal that I am moving from a simple set of commands to something more complex with logic that will need objects, arrays and possibly a package manager.
- joncp 5y agoWell, the whole reason to choose bash in the first place is that it just works on every single machine I have access to.. Ruby and js aren't installed everywhere. As for python, I have to be willing deal with versioning hell and the whole virtualenv vs venv vs conda mess. Maybe C could work, but I have to make sure it's statically linked.
- pwdisswordfish8 5y ago> Ruby and js aren't installed everywhere. Neither is Bash, despite belief to the contrary.