Is there a name for oft-repeating content/post and the overall discussion on a given topic (dotfile management in this case) on HN?
I am not complaining about the repeat. It’s just that I find it very amusing to see different people kinda-sorta reinventing the wheel (and discussing the nuts and bolts) again.
Note that the design of the experiment needs to be able to disprove theory. That is to say if the results don’t match calculations then their theory is falsified and we make progress.
Interesting to think that a successful experiment is one that disproves a theory, or, in other words, one where the numbers aren't the ones one expected.
A successful experiment can also support a prediction. I.e., "using this model, we predict that a bagel with blueberry cream cheese will remain on the counter for 94+/-4 seconds before disappearing." The team will then release the data from their experiment, which either supports or disproves a model.
This kind of work is critical to refining theories and highlighting/fill gaps in knowledge.
Most linux distributions come with python installed. Anything more than invoking a binary and redirecting the output? Just write it in (pure) python I say!
Edit: by pure Python, I mean don’t require any `pip install`s
Python is terrible at juggling files, setting up pipelines and working with processes. The resulting code is more complicated than the equivalent bash, not to mention longer, and hidden gotchas abound (subprocess deadlocks anyone?). I'll take 50 lines of bash instead of 200+ lines of Python.
Welcome to (shameless plug) Next Generation Shell. It's a modern programming language for DevOps. It is both concise for running external programs (uses small subset of bash syntax) and it is a "real" programming language with data structures and sane error handling among other things.
Ability to run external programs is high on the priorities list. In NGS it means having its own short syntax and handling exit codes among other things. NGS throws exceptions on "bad" exit codes. Hint: not for all tools non zero exit code is "bad". Did not see equivalent exit code handling anywhere else.
Compared to bash... It's not fair comparison even. Another era, another reality, other expectations. Small example: When APIs return structured data, well... you better be able to handle it. See https://ilya-sher.org/2018/09/10/jq-is-a-symptom/
Compared to other modern shells, I would say, NGS is programming language first as opposed to shell first.
This has only been true for the smallest shell scripts in my experience: bash will be less code at first but once you to be portable, handle errors, locking, unicode, buffer or process output, perform non-trivial redirections, or need any data structure more complicated than a simple string it's been pretty common to replace hundreds of lines of spaghetti bash with less Python even after you add comments and a proper CLI interface.
I've never had subprocess deadlock — was this on Windows?
Interesting, I've never had that happen in heavy usage. I've had cases where the called processes blocked for some reason but that was solved by adding a timeout.