3 ms·
Which is very sad, because I think first-class support for `--dry-run` is a great way to architect a tool! Anything I write for which it's meaningful is divided
by Smaug123 6y ago
Which is very sad, because I think first-class support for `--dry-run` is a great way to architect a tool! Anything I write for which it's meaningful is divided into a "work out and represent in memory what I'm going to do" stage and a "do it" stage. Then `--dry-run` is a simple matter of `print` instead of `execute`.
This paid off really well for me recently, where the `execute` stage turned out not to be fit for purpose, but the statement of intent was all still correct. The rewrite didn't have to touch the "gather" stage at all. Huge rewrite becomes naturally much more limited in scope. Just another tool in the modular-design toolbox: you create a strongly-typed API boundary down the middle of the program.
(hashtag defunctionalisation)