3 ms·
I was in a meeting with a major vendor and a bunch of fintech leads recently and major vendor's techie said '...no-one likes bash scripts...' After the meeting
by zwischenzug 9y ago
I was in a meeting with a major vendor and a bunch of fintech leads recently and major vendor's techie said '...no-one likes bash scripts...'
After the meeting I said to colleagues, 'I quite like bash scripts, actually', and they all said 'I thought that too...'
- oblio 9y agoWell, shell scripts are extremely convenient. It's easy to write very simple ones since they're a natural extension of shell usage. So it's really easy to go from $ command1 $ command2 to: #!/bin/bash command1 command2 As a result, everybody "likes" bash scripts since they're so easy to write, initially. And these shell scripts will work well in 80% of situations and you can get them to 90-95% just by sprinkling a few ifs around. Once thes script becomes longer and more complex and you want to make them easier to read and DRYer, that's when the pain begins. Or when you need to handle a bit of logic which would be trivial to do with better data structures such as arrays or dictionaries or sets... You can work around these issues, of course, but almost every workaround is either ugly or a hack (as someone was joking, "elegant hacks" for older Unix hackers, "gross hacks" for younger ones :) ).
- growse 9y agoI agree - in my experience bash is extraordinarily easy to write the first time. It becomes a nightmare to maintain, because most people aren't actually that familiar with how bash error handling, flow logic etc. actually works. It's bad because it fails in surprising, non-conventional ways.
- yjftsjthsd-h 9y ago> better data structures such as arrays or dictionaries or sets POSIX sh doesn't have these, but BASH actually does have arrays, and even dicts (see https://stackoverflow.com/questions/688849/associative-arrays-in-shell-scripts/691157#691157 https://stackoverflow.com/questions/688849/associative-array...)
- nerdponx 9y agoAnd if you're willing to spend time learning Zsh, you have a surprisingly reliable and expressive language. Or you could just learn Perl...
- kps 9y agoOr ksh, which bash was a half-assed imitation of. Or if you're just stringing commands together, traditional simpler Posix sh (note: 'bash --posix' isn't).
- blowski 9y ago"I don't like Bash scripts. Therefore nobody likes Bash scripts."