5 ms·
Bash scripts don’t break, when left unattended for months/years. Python scripts do.
by yakubin 4y ago
Bash scripts don’t break, when left unattended for months/years. Python scripts do.
- hobs 4y agoPin your versions. Also - to make the equivalent safe bash program compared to a typical python implementation is ... a lot of work. Enough that imo the python version is worth the maintenance.
- D13Fd 4y agoPinning versions doesn’t help when the old version of some dependency no longer works with your new OS or hardware. I mostly only code in Python but this article really spoke to me. I have <10 personal Python scripts that I use heavily for my job, but they are such a bear to maintain. Meanwhile my two old Autohotkey scripts that I wrote 10+ years ago and rarely touch still chug along perfectly.
- kaba0 4y agoIt can’t break if it were never correct in the first place. Bash scripts are always chock-full of bugs, and only work when everything in its environment is the same. That folder now has two files instead of one? Now it just stops working.
- yakubin 4y agoIn my experience, they don’t have more bugs than Python scripts. That’s assuming they’re shorter than 50 LOC. Long before my scripts reach this size I convert them straight to Go. That’s the most problem-free strategy.
- silverwind 4y agoThe recent deprecation warning message of `egrep` is a prime example that bash scripts can break (depending on stderr processing). They will definitely break once the alias is removed.
- pcthrowaway 4y agoegrep has been on a deprecation path for 15 years, and the replacement is incredibly straightforward. Also, I think egrep will generally just continue to work. I'm not sure what you mean by "recent", but this is more longevity than we get in the node/JS world. I'm primarily a JS (now TS) dev, who also throws bash at things when it makes more sense, but let's not kid ourselves that it's the same.