3 ms·
+1. Bash is riddled with absurd footguns. You want to set hack together three git commands and pipe to fzf? Fine. Anything more complex than that? Python, Perl,
by underdeserver 3y ago
+1. Bash is riddled with absurd footguns. You want to set hack together three git commands and pipe to fzf? Fine. Anything more complex than that? Python, Perl, or any other proper programming language is there for you.
- abwizz 3y agoi'd argue that every language is somewhat imperfect, but there is something to be said in favor of pitfalls/footguns/inperfections that are somewhat well defined and understood for more than a decade.
- jdiff 3y agoA footgun doesn't stop being a footgun with time. New generations of programmers and shell scripters are constantly rolling through and shooting their toes off. Just because there was a "well, that sucks, but it's the least worst compromise" 4 decades ago doesn't make it a good reason today, doesn't make it intuitive today, and doesn't make it not still a horrible footgun today. A familiar footgun is still a footgun.
- ur-whale 3y ago> Bash is riddled with absurd footguns I agree, shell programming is ugly and very unsafe. > Anything more complex than that? Python, Perl, or any other proper programming language is there for you. I disagree. First, there are certain things, specifically when you want to process very large datasets that are easiest - by a very large margin - to build using shell scripts: a combination a ripgrep, sed, awk, grep, cut, tr, paste, jq, head, tail, etc ... is way easier and faster to put together in bash than anything else. Second, to get maximum flexibility you'd like to be able to switch from one (python, perl) to the other (shell script) transparently and both ways Do certain things that can be expressed cleanly in python, and then transparently switch to bash calling a horde of specialized shell commands when the task at hand is easier to express that way. Shell can transparently go down to Python or Perl very, very easily. Unfortunately, the converse is absolutely not true: while Perl can - to a certain extent - be used to construct complex pipelines of data processing external commands, it is nowhere near Shell in ease of use. And it is a giant PITA in Python which gives you fuck-all above exec/fork level subprocess manipulation: writing large external pipelines in Python is about as easy as it is in C.
- 0xbadcafebee 3y ago> > Bash is riddled with absurd footguns > I agree, shell programming is ugly and very unsafe. Sharp knives are "unsafe". Kids shouldn't use them. Professionals prefer them. I find most 'footguns' to be normal expected behavior, and the user shot themselves in the foot because they're careless or ignorant.
- BossingAround 3y agoThere's a difference between using a sharp knife, and a hammer that has been sharpened on one side so that it's usable as a knife, and pointy on another side so that it can be used as a weapon in case of a home intrusion, while keeping one side as an actual hammer and the handle is covered in honey for more friction in case your hands get sweaty. Both can be unsafe, but one is a professional tool while the other is an abomination for our current standards.