Preparing a task
It all starts with defining precisely the work that needs to be executed, and designing it in a way that doesn't require human intervention to run.
Some ideal characteristic points are as follows:
- Single, clear entry point: No confusion on how to start the task.
- Clear parameters: If there are any parameters, they should be as explicit as possible.
- No interactivity: Stopping the execution to request information from the user is not possible.
- The result should be stored: In order to be checked at a different time than when it runs.
- Clear result: When we oversee the execution of a program ourselves, we can accept more verbose results, such as unlabeled data or extra debugging information. However, for an automated task, the final result should be as concise and to the point as possible.
- Errors should be logged: To analyze what went wrong.
A command-line program has a lot of those characteristics already...