3 ms·
> need to know of a million tiny gotchas to implement even the simplest task safely and portably While this is clearly exaggeration, I'm not sure I find much m
by carlinigraphy 2y ago
> need to know of a million tiny gotchas to implement even the simplest task safely and portably
While this is clearly exaggeration, I'm not sure I find much merit in the argument.
C is full of gotchas, footguns, and a tremendous threat vector. But it is also the standard for many uses.
Yes, bash has legacy cruft, and potentially confusing ways of doing things. But for the realm in which it operates, it is extremely effective. We can make an argument for what we believe the perfect shell scripting language would be--but that doesn't exist. Bash is the current tool for addressing this category of problems.
The intention of this bullet point was to illustrate that just as I wouldn't work in an industry/role requiring C tools, and instead turn to some weird, novel, riddled-with-problems transpiler... I'd just learn C.
(P.S., bats[0] and shellcheck[1] address many problems noted in this thread.)
[0] https://github.com/bats-core/bats-core
[1] https://www.shellcheck.net/
- 8372049 2y ago> While this is clearly exaggeration, I'm not sure I find much merit in the argument. > > C is full of gotchas, footguns, and a tremendous threat vector. But it is also the standard for many uses. (I'm not GP) Yes, and the same way there's a plethora of bash-alternatives in the making, there are multiple languages trying to essentially be a "better C", such as Go, Rust and so on, not to mention C++ and its descendants. I definitely think there's room for an improved bash. The biggest question is whether an alternative can become ubiquitous enough to be a fully qualified alternative.
- lamontcg 2y agobash isn't even ubiquitous enough to be a fully qualified alternative. people still get paid to care about things like solaris 9 and aix 6.
- carlinigraphy 2y ago> I definitely think there's room for an improved bash. Absolutely! I wholeheartedly agree, and would love for such a project to exist, and see sufficient adoption such that it's a standard at my job. I may not have articulated my prior point precisely enough. Too often I'll see a professional JS programmer (for example) who will forego everything they've learned the second they touch a shell script. No useful comments, no functions, poor design & implementation, no care towards idioms, no regard for readability/maintainability. Given that bash is currently the standard, someone is better served by actually learning it than a worse, novel alternative. Any successor must encompass the power and feature-set that exists within contemporary shell scripting.
- lamontcg 2y agoThe reason why it is attractive is to enable people who aren't ever going to get proficient at writing/debugging bash/sh to the level that you're at, to write enough bash/sh to get their jobs done both quickly and safely. The majority of people doing DevOpsey kind of stuff aren't remotely experts with what they're working on, and won't ever be experts, but work still needs to get done.
- sgarland 2y agoMaybe if those people started visibly failing at their jobs, they'd either upskill or be forced out, and then the magical hand of the market would raise salaries for the rest of us.
- lamontcg 2y agoOh look you're basically me in 2006 thinking that all the sysadmins that couldn't be bothered to learn a real programming language needed to be replaced by people in India who weren't intellectually lazy (because I was a bit of an asshole and wrong).
- sgarland 2y agoI'm against intellectual laziness in general; I don't care what your nationality is, just don't be incurious.