I like the idea, but I wouldn’t really know how to put it into practice. It works quite well, if you’re using Python to automate, but if you’re using more dedicated tooling for CI/CD automation (à la Ansible, Puppet etc.) then those tend to not really have a way to pause execution until a user input happens. It’s kind of anti-thetical to their end goal…
I guess, you could have a Python or Bash script, where each function just calls an Ansible task and once you’ve automated a chunk, you replace that with an Ansible playbook. But yeah, really not sure, if that’s terribly sexy in practice.
Highly recommend having some scripting/interpreted language in your stack – in fact you likely already do (consider how shell scripting makes up a significant part of Dockerfiles)
It’s an incredibly useful intermediate between freeform-but-non-executable text/docs/wikis and “industrial-grade”-but-inflexible tooling
In other words, a great fit for capturing this partial/incomplete/tribal knowledge space the post is talking about. I personally even go a bit further and actively advocate for converting “onboarding/operational docs” from wikis into scripts that print out the equivalent text that can be committed and incrementally automated.
It’s an interactive checklist.
I have nothing to add except: man’s really wrote like 7 classes to just have 1 function each
It’s probably to allow for added complexity as they expand on each task. Makes it simpler to import elsewhere too.
I would very much argue that you shouldn’t add complexity unless you actually make us of it. Them all using a uniform structure doesn’t help readability nearly as much as just not having the complexity…
"grug try watch patiently as cut points emerge from code and slowly refactor, with code base taking shape over time along with experience. no hard/ fast rule for this: grug know cut point when grug see cut point, just take time to build skill in seeing, patience
sometimes grug go too early and get abstractions wrong, so grug bias towards waiting
big brain developers often not like this at all and invent many abstractions start of project
grug tempted to reach for club and yell “big brain no maintain code! big brain move on next architecture committee leave code for grug deal with!”
That is what makes it Enterprise-grade!
Honestly, if they want to go full enterprise at least use the javabeanfactoryfactoryfactory pattern
Pretty nice way to bridge the gap between documentation and automation.
TLDR:
What the author baptizes “do-nothing scripts” are interactive scripts that print out the steps of some procedure one by one and wait for you to confirm each step (eg. “1. do this. press enter when done” “2. do something else. press enter when done” and so forth).
PS:
@OP (if you are the author)
I HATE those sites where popups come up when you are halfway reading something.
What’s the idea behind it, besides annoying your users as much as possible?
Not my site, just sharing a link I saw on HN.
They kind of glossed over the real value, which is using it as a template to automate a step at a time:
“Each step of the procedure is now encapsulated in a function, which makes it possible to replace the text in any given step with code that performs the action automatically.”
It breaks the work down into more manageable tasks. I probably wouldn’t give it to users until it was done, but putting placeholder functions is a common strategy.
That’s a very nice idea, and something I’ll definitely implement for some annoying tasks in my company.