3 ms·
Nothing against a good old shell script. But there is IMO a threshold of complexity beyond which shell scripts become unwieldy and where any scripting language
by atoav 5y ago
Nothing against a good old shell script. But there is IMO a threshold of complexity beyond which shell scripts become unwieldy and where any scripting language starts to become the more rational choice.
I still have python scripts from 10 years ago that happily do their job. I just had to swap print foo for print(foo) at one point when I changed from python 2 to 3 everywhere
- MathMonkeyMan 5y agoYou're lucky. The str/bytes/unicode change and the related standard library changes broke almost every python script I'd ever seen or written. It starts in libraries that you depend on -- wrappers around C code and whatnot, and then it just infects everything and breaks the world. I'm happy to be writing all my python as python 3 now. It took ten years.
- pfranz 5y agoThe rule of thumb at a previous job was if the shell script is longer than about a page then consider if another language is more appropriate. That seemed to serve me well and I had dozens and dozens of personal shell scripts to smooth over rough edges of everyday tasks. It's also obvious when you start needing features like more than simple usage or flags or parsing html. I haven't had all that much experience with Python 3, but for the 2.x series there were often tweaks that needed to be made either with code or libraries when moving between new releases with a large code base. Lastly, Python just isn't great for making one-liners. It might be a personal quirk, but that's my favorite way to iterate over an problem. With all that said, I do really like Python and use it heavily.