4 ms·
Genuine question, why not? The Bash shell is one of those things that people love to hate on, and yet -- it's still here. What makes this approach inferior?
by jrm4 5y ago
Genuine question, why not? The Bash shell is one of those things that people love to hate on, and yet -- it's still here. What makes this approach inferior?
- XorNot 5y agoA shell and a programming language accomplish very different things - i.e. there's a reason pure Python makes for an annoying shell but is the next step up once you get even a little complicated.
- dijit 5y agoSure, I should be clearer! Shell semantics are terse and powerful, single character changes can completely alter the control flow of a sequence and can be very difficult to follow. Managing data structures is also full of foot guns. I don’t want to be too specific because you can “get around” a lot of issues if you know what you’re doing, the problem is that it’s very easy to introduce subtle bugs and not know about them for a long time- or that you can introduce bugs and not understand how or why. Shell works great for piping together series of text and running commands in sequence and conditionally; but once you’re at the point where you’re parsing config files to do control flow and you’re sourcing more than a handful of files then controlling the quality of the script becomes very difficult. Personally, I’ve written 100kLOC bash, I’m very comfortable with the semantics, but I still get tripped up sometimes because of some weird quirk that is not widely understood.