4 ms·
I've changed my mind about this sort of thing recently. I disagree with the widespread belief that one should part with shell scripts as soon as possible. Yeah
by andrewmcwatters 5y ago
I've changed my mind about this sort of thing recently. I disagree with the widespread belief that one should part with shell scripts as soon as possible.
Yeah, there are definitely eventually scripts where one should rewrite the work in another language, but we now just have too many people who have no idea what getopts is, too many people who think bash is available everywhere, too many people who think it's a good and safe idea to put all of your program arguments in environment variables, too many people who have no idea where POSIX specifications are and why they're useful, too many people who don't know how to simply reach for manual pages and do all their learning exclusively off Stack Overflow and Medium, etc.
You don't need advanced knowledge of all of this stuff, but when you're outright afraid of it, there's a professional problem involved. I'm not asking for people to have a comprehensive knowledge of awk, but if you've avoided every opportunity to simply understand what 'set -e' 'if' and 'test'/[]' are, you're intentionally atrophying your professional development.
- klabb3 5y agoThe reality is that blame shaming devs for not learning something isn't effective. No matter your personal beliefs, nobody is getting fired for not knowing the intricacies of sed or bash or awk. The only options are keeping archaic artifacts around and have the elders maintain it, or improve it for everyone. I have tremendous respect for our unix/posix legacy but at the same time they didn't get everything right. How could they? That said, it's harder to build consensus today. Currently people are replacing shell scripts with all kinds of stuff, and that's not good either. We need something good enough and ubiquitous, imo.
- smackeyacky 5y agoI am a greybeard, old school kinda unix guy, but at some point insisting everybody learn latin to understand the scriptures is just not going to work. As long as Powershell dies I'm more than happy to agree that any bash script that exceeds 24 lines should probably be written in something newer.
- majkinetor 5y agoWeird bigotry.
- dale_glass 5y agoWeird, because to me powershell gets very many things right. Granted, it's a bigger more complex system, but in many cases it gets stuff done a whole lot better.
- usrbinbash 5y agoAs you can probably guess from my username, I am among the last people who would disagree on the usefulness of common shell utils, and the benefit of knowing them. But I still hold that one should rewrite into a proper programming language, as soon as a shell script becomes too large, and that point is usually around the 100 LOC mark. Yes, I can do amazing things just with sh/bash and the coreutils. But a small Go program or python script, is just alot more readable, at least imho, because they impose STRUCTURE, which the shell lacks on purpose: It's a CLI first, and a programming language second. I can read through several hundred lines of Go in one sitting. When asked with analyzing some old bash script, and `wc -l` tells me something along the lines of 400+, I grab the coffee machine and bring it to my desk.