I was curious as a kid, and I had begun exploring the strange desires I was having with BASIC, but it was never serious between us and we eventually went our separate ways. I was perusing degrees in Biblical studies, while BASIC was off going wherever programming languages go to die.
I started using Linux in my early twenties and became interested in doing some OS automation. I wouldn’t say BASH was my type (and my tastes were still developing), but it was so available, so accommodating—and frankly so ready to be used. Not the prettiest language at the ball, but the thing that got you hooked was that any program you’d messed with for one-shot stuff at the command line, BASH was more than willing to welcome. You know the script: unzip, touch, finger, mount, fsck, eject, umount.
But that dream started to turn into a nightmare. There were signs I should have seen earlier. We had communication problems. I was like, “babe, how do you iterate on an array again?” and BASH was like “for item in “${myarray[@]}”; do ...”, and I would just think to myself, “geez, maybe I’ll just refactor into a pipline instead…”
There was also passive-aggressive behavior, I would forget to quote one little variable name and BASH was like “oh, let me just retokenize this string for you on whitespace.” WTF, BASH? Who does that?
There were other things I’d heard about BASH. Dark things. I don’t know if this ever happened while we were together, but I’d heard from others about its proclivity to allow code to be injected from untrusted sources—a penetration tester’s wet dream. I ignored the warnings.
The fact that I was in Biblical studies on the one hand but was doing really freaky things with BASH on the side was a tension I eventually couldn’t keep together. For a long time, I lived a double life: doing my academic Bible work in the traditional way, but also having my little “secret”. I eventually tried to bring those two worlds together, and that’s when the dam burst. I wanted to do some analysis of Biblical texts, and you could use tools like AWK and sed in BASH, so I thought I’d give it a try. BASH just wasn’t ready to deal with complex data, and I was loosing my mind trying to square peg that round hole.
Then I met Python. I’d been hearing about it for years, of course. This mythical language that was super easy learn but could scale up to the most complex problems. I had to admit that Python was pretty, even elegant, but BASH had sort of ruined me. In BASH, anything goes. You can put together the most obscene pipelines with programs of every size and shape, and BASH offers no resistance. Python wouldn’t let me just do whatever I wanted. Want to bring in a third party? You have to import it properly. No namespace pollution allowed. You want to use global variables? Not without the right paperwork. Run shell programs? Well, we’re going to take extra precautions to make sure everything is safe.
However, over time, I realized that BASH’s unchecked receptiveness to all my crazy ideas wasn’t good for me. It was allowing me to indulge desires that simply were not healthy. Python’s standards gained my respect and ultimately made me a better programmer—and when it comes to complexity, let’s just say the Python goes deeper, by which I am, of course, referring to nested and recursive data structures. It’s dicts all the way down, baby. BASH gave me what I thought I needed in the moment, but Python was there for the long haul to solve actual hard problems.
I have to admit, I sometimes loose self-control and go back to BASH, and it’s as ready and willing as ever, but it becoming less and less often. Having learned some of the subtleties of Python and how to get the most out of its dict, I’m just so much more fulfilled and I find I don’t even want to turn to BASH for cheap tricks.