DEV Community

Discussion on: Your bash scripts are rubbish, use another language

Collapse
 
gwutama profile image
Galuh Utama

I have my own rules regarding bash.

Use bash for:

  1. init scripts
  2. scripts that will barely grow in the future
  3. scripts that are less than 50 lines of code

Use python for everything else.

Collapse
 
taikedz profile image
Tai Kedzierski

Yes in principle however

init scripts

If that script grows arms and legs, you'll have wanted it to be just the glue that calls the more complex parts (in other-lang)

scripts that will barely grow in the future

I'm sure you are seasoned enough to know, this NEVER goes to plan :-D

scripts that are less than 50 lines of code

I would say, less than 20 lines, but I've written ones more than 300+ lines. I just wrote them cleanly, namespaced the heck out of the functions, and re-used code as much as possible (the reason behind my bash-builder project)

I mean yes, I do agree with your points, but life has surprises, of which Inexperienced Colleagues is but one of many...!