In the documentation for the services I develop and maintain, there is a section where the program execution flow is presented as a numbered list, somewhat like a flowchart.
Here's a silly example that documents the process of driving to work in the morning:
- Fetch keys from kitchen counter
- If no key found, exit with error code 101
- Get in the car.
- Start the car.
- If the car will not start, exit with error code 102
- Drive along the route (shown below in image)
- If you are hungry for something savory:
- ... some steps for going to Taco Bell and buying a breakfast burrito
- Otherwise if you are hungry for something sweet:
- ... some steps for going to Dunkin Donuts and buying a donut
- Otherwise if you are thirsty:
- ... some steps for going to Starbucks and buying coffee
- Arrive at work and park the car.
Steps 5-7 are obviously an if/else decision tree. This is the best format I've come up with so far, and it works well enough, but I feel like there could be a better way.
Is there a standard way of doing this? Or does anyone have suggestions?