Hacker Newsnew | past | comments | ask | show | jobs | submit | sdwr's favoriteslogin

I'm adamantly pro dry-run and like OP I've found that you really need to design for it. From my experience, OP's two main ideas are spot on: librarification and pushing dry-run logic deeper into library code.

Here are two other things I've found:

1. Regardless of where you push your run/dry-run dispatch to, the underlying "do it" logic really needs to be factored properly for individual side effects (think functional). Otherwise, you inevitably end up with loads of "if dry-run / else" soup or worse, bugs _caused_ by your dry-run support.

2. You still need safety nets for when someone is doing dangerous operations without dry-run. Pointing and calling [0] is a great trick for this. For example, say your tool is about to delete X, Y, and Z. Instead of a simple "Yes" confirmation which the user would quickly end up doing on auto-pilot, you could have a more involved confirmation like "Enter the number of resources listed above to proceed" and then only proceed to delete if the user enters "3".

Very curious to hear about design idioms folks have come up with!

[0] https://en.wikipedia.org/wiki/Pointing_and_calling


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: