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

Money and Happiness as a fungible resource

Money really does buy happiness. Anyone who tells you differently has a vested interest in keeping you poor, unhappy, or both. I know this because I grew up on the ragged edge of poor, and then backed my way into a career in IT, which is where the modern world keeps all the money that isn't in Finance. So I am one of the extreme minority of Generation X that actually had an adulthood that was markedly more financially stable than my parents. And let me tell you: money really does buy happiness. To be clear: at 45 years old, I'm now in a relationship and a period of my life where our household is effectively double-income, no kids. I live in the city, but I own a house, and can only afford to do that because of our combined income. We also have two cars -- one new, one used (though neither of them is getting driven very much these days) -- and we have a small discretionary budget every month for things like videogames, books, and the like. What my brother used to call DAM -- Dic

Occasional Media Consumption: Man of Steel (2013)

Every so often, there's a movie where I watch it and think, "that was pretty bad", and then time goes by, and I see other people talking about it, and so I watch it again, thinking I was too harsh on it, and after watching it again, I think "not only was that movie bad, it was worse  than I remember". I try very hard not to hate-watch anything, movies or TV or whatever, because that's a waste of time, energy, and emotion. My expectation was that my first reading of this film was overblown, that my reaction to it was as an outsider, someone who didn't know the depth and breadth of the Clark Kent / Kal-El story, and who couldn't appreciate the subtleties or easter eggs or whatever. But in the intervening years, I've read a bunch of DC comics, and many of them Superman comics. And I've come to a conclusion upon rewatching this movie, one that surprised me given the budget, the cast, and the story being told. Rarely has any movie so misunderstood

Occasional Media Consumption: Justice League (2017)

So let's get this out of the way first: this movie is bad. I mean, it's bad . And not in the way that most superhero movies are bad, though it is bad in that way too: inconsistent characterizations, lack of understanding of motivations, weirdly-shot fight scenes, dodgy use of CG, etc. I mean, it is bad in all of these ways too, especially the whole thing where they digitally removed a mustache from Henry Cavill, who's honestly doing his best with a bad script and a character he's fundamentally unsuited to play. Gail Godot, in an iconic roll for her, suddenly shoved out of the way to make room for (also fundamentally-miscast) Ben Affleck's the Batman and Cavill's Superman, And Ray Fisher and Ezra Miller trying to introduce characters that honestly deserve their own movies. Jason Momoa's Aquaman got his own movie, but as far as I can tell he's just stepped into this one from a whole different universe and is basically pretending to live in the grim-n-gritt