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

What I did on my Spring Vacation -- Day 2, Monday

We got up Monday morning pretty late, and Jean's family was kind enough to supply us with breakfast, and then we headed back south again into LA to meet up and celebrate Jean's birthday with her friend Damon and our friend Ryan.  This involved driving through late-morning LA traffic, which resembles rush hour in PDX; rush-hour LA traffic closely resembles the parking lot of a Wal-Mart on Black Friday. A note on traffic:  I do not understand how people in LA stand sitting in their cars for so amazingly long.  It's terrible. Ryan was driving down from San Francisco, so we went to lunch at Berth 55 Seafood Deli in Long Beach.  Jean had seen good reviews, and we knew driving up to it (it's a real hole in the wall sort of place) that it was going to be delicious.  So we had fresh clam chowder in sourdough bowls and honestly, we should've split one rather than getting two of them.  It was amazingly good.  From there we drove down the Long Beach main drag and got a gr

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

Commit! Commit, damn you!

I used to joke, as recently as last month, that I knew I needed to be healthier but the choice of getting that way involved a lifestyle change to which I was not prepared to commit. I think, though, that the last trip to the ER where I was *content redacted* from my *content redacted* sealed the deal. I can't continue to live my life as if I were 25 and assume that my body will always recover from anything I put it through. I have real, chronic health problems that continue to affect my day-to-day situation, that have real, deleterious effects on my ability to function as a person. Note that it's not like I have anything serious like Crohn's Disease or Lupus or anything that many, many others that I know suffer through every day. In my case these are low-level, annoying-but-not-ultimately-fatal things like Kidneystones and Intermittent Benign Positional Vertigo and a bad back and weak knees. These are all things that with a proper diet, a good workout structure, and c