Skip to main content

...Or I Will Replace You With A Very Small Shell Script

Once again I remain convinced that there is no problem that is insurmountable when a possible first-draft solution includes a hacked-together bash script.

I spent the better part of an hour trying to bang my head against Windows, gave up, and grabbed my Mac laptop, opened a terminal, and accomplished the end-goal in 10 minutes, which included writing my own hacky first-draft do_the_thing.bash file. More and more, my solutions (including production-ready solutions in some cases) start life as do_the_thing.bash, and eventually evolve into a proper script with error conditions, failure modes, self-checks to prevent multiple runs, etc. But mostly, they start as do_the_thing.bash, which I blame a developer friend for doing in front of me and thereby teaching me terrible habits.

My own personal goal, after I get back from my convention trip, is to throw away do_the_thing.bash and rewrite the entire process, soup to nuts, in python (including checking for ruby and installing it if needed, among other steps)(and yes, I know, but ruby is also a thing I should be learning, and I feel like this is a good test case for that). I'll be leaning heavily on my more advanced dev resources (aka, my friends Rachel and Matt), but this is the first project I feel really excited about trying on my own.

When I was just making the transition from Tech Support person to DBA, I was often convinced that it was faster and easier for me to just execute a given command directly, rather than building a tool that executed a command. But as I've grown and matured, I've been put in positions where the execution of a particular command isn't the issue; it's the repeated execution of some set of commands that must be automated, and so I've built up a repository of script fragments stolen researched and designed as a library. It happened in bash and SQL; it's starting to happen in python, and I imagine as I get more dev experience it'll happen more and more in other languages. Often the hardest part of learning is making the transition from reinventing the wheel to recognizing that it's not always necessary to reinvent the wheel. Wheel-inventing is an important step; that's the point where I'm learning the "why" of things, not just the "how".



For now, though, I'm all about do_the_thing.bash. Or do_the_thing.py, or do_the_thing.js, or whatever. First build a skateboard. Then build a bicycle. Then build a motorcycle. (As a life-long motorcycle rider, we can just stop there.)

Comments

Popular posts from this blog

The default state of technology is broken.

Score one for DRM making me a pirate. I had bought a blu-ray player for my new computer so I could watch hi-def movies on my entertainment-center projector. Apparently, despite paying extra for the hardware, I needed software to play the blurays. OK, fine, I said, and the person who helped me build the machine downloaded some software that would play the blurays. Then, tonight, I went to watch my copy of Inception, and it played for 4 minutes, at which point the software stopped working and insisted that the bluray disc wasn't valid, unless I ponied up $60 (59.95, 25% off for the new year!) to "upgrade" to the latest, licensed version of the software. So, not only did I have to pay extra for the hardware, and extra for the media, I now have to pay extra for the software. Pardon my language, but FUCK THAT SHIT. So, now I'm working on finding a less-expensive way to watch the movie (well, actually, the extra content) that I ALREADY BOUGHT. I've also uninstalled th

Occasional Media Consumption: Swordheart, by T. Kingfisher.

I'm not sure how to say what I want to say without saying it wrong. I don't think I have been this excited for a new author's work since I was in the rapid process of discovering and then chewing through the back catalog of C.J. Cherryh, who at that point had just published Foreigner and grabbed me by my whiskers and screamed (metaphorically) "Look! Here is an author whose style of prose and choice of character speaks directly and entirely to you!" Or that moment in my high school years when I stumbled upon Melissa Scott's Trouble and Her Friends and I suddenly knew, with a certainty that has still not yet left me, that I wanted to be a part of the future (and the culture) of technology. And yet that's not fair, because T. Kingfisher, nee Ursula Vernon, is her own writer, her own voice, her own authorial person, and doesn't deserve to be compared to others.   To say that Kingfisher's prose style and choice of genre (which is to say, a

What I did on my Spring Vacation -- Day 3, Tuesday

We arose on Tuesday morning quite early, as we needed to get across town from Hollywood to Anaheim. Note on geography in LA:  I have no mental map of anything that has to do with Southern California.  I only know that every time we got in a car, it took two hours to get where we were going.  That was as true of the 100-mile drive on Monday as it was for the 1 mile drive from the hotel to the nearest In N Out on Thursday.  So no idea what that was about. We had tea and coffee with Damon, waiting for Ryan and his friend Megan to arrive, which they did around 7:30.  From there, we said a teary goodbye to Damon and headed out to Disneyland! A note on Disneyland:  I'd never been before.  This was my first trip and I was not exactly expecting anything special.  However, everyone around me (including Jean, Ryan, and our friend Donna) was very excited, so I was ready to be happy but underwhelmed.  Boy, was I wrong. We reached the parking lot just before 9 AM, and there was plenty