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

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...

#RPGaDay2018 Day 12: Your Wildest Character Concept?

I've always liked to play characters that are more than a little off-of-plumb, so this isn't actually very easy to figure out. I mean, aside from the geth detective-inspector, or the kobold necromancer, or the Paladin of Kuan-Yin who was forbidden from killing anything? I think the one that stands out the most to me at this point, looking back, is my halfling bard / gunslinger, Otto. He was designed to have the fastest mouth in all of Ptolus; all (and I mean ALL) of his resources were dumped into bluff and intimidate, and his perform skill was "monologuing". He was entirely about establishing a baseline of being a badass, and making sure no one noticed that he had absolutely nothing to back it up. Otto did eventually end up with a decent shooting skill, but other than that, he was mostly about talking himself into (and not nearly as often out of) trouble. Otto was fun.

#RPGaDay 2017 -- Day 18

Which RPG have you played the most in your life? If you count all the editions of D&D as one RPG, then the answer is D&D. I never was serious about 1st or 2nd Ed., but I was part of a 3E playtest group, and I started a 4E campaign basically as soon as I could. If you don't count all of the D&D editions as one, then the answer is HERO system, specifically Champions 4th Ed, the Big Blue Book. I was part of a group that played with the BBB for quite a while, through two multi-year campaigns. I have to admit, there is something rather satisfying about chucking great fistfuls of d6s across the battlemat and being able to figure out the body damage basically instantly. After that, I think it's GURPS, and then after that would be Pathfinder, and then 4E. I've dabbled so much with so many systems that the long-term campaigns basically swamp everything else.