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 Experience of Diversity (and the blindness of privilege)

Last year I made a vow to myself that I would only read books written by authors who were not straight white men. By and large, with two explicit exceptions, I was successful in my goal. And I learned a bunch of things. The first (and most important) thing I learned is that my reading habits were already moderately diverse; I made a list of ten of my favourite authors and nine of them were women, so I didn't really have to give up on anyone that I was particularly invested in. The second thing I learned was that my "historical read" list is actually pretty white/straight/male, though; I often go back and read a book again for comfort's sake, to go over familiar territory and comfortable writing and try and find something new or at least interesting. That means I haven't been doing a bunch of rereading and that led to... The third thing I learned, which is there are a LOT of non-cishetwhitemale writers in SF, both historically and especially currently. Just l...

Organizing And You: Lessons from Labor History

    I made a joke on Twitter a while ago: Do I need to post the Thomas M Comeau Organizing Principles again? https://t.co/QQIrJ9Sd3i — Jerome Comeau says Defund The Police (@Heronymus) July 15, 2021 and it recently came back up because a member of my family got their first union job and was like "every job should be offering these sorts of benefits" and so I went ahead and wrote down what I remember of what my dad told me. My father had many jobs, but his profession was basically a labor union organizer, and he talked a lot about the bedrock foundation items needed to be serious about organizing collective action. Here's what I remember.    The Thomas M. Comeau Principles of Organizing -- a fundamental list for finding and building worker solidarity from 50 years of Union Involvement. This list is not ranked; all of the principles stated herein are coequal in their importance. Numbering is a rhetorical choice, not a valuation. 1) Be good at your job. Even in...

So that happened.

I couldn't resist, and didn't really want to. So I bought an iPad. First Gen, but they're on significant sale right now, so I can use this one until July or august, when I'll buy an iPad2 and give this one to someone else. I named it "conspicuous consumption" because it seemed like truth in advertising. FYI, this blog post is coming from inside the tablet!