Best Practices

While you can jump right in and start designing Prog commands, there are some best practices to keep in mind if you want to create Progs that are easily maintainable and shareable with others.

Decide if the Prog will be a “Building Block”

You can create Prog commands with extensibility in mind. For example, the official Proggy repository contains a number of Prog commands to help set up services like PostgreSQL and Redis.

You can see from these examples that they all utilize the Run (Other) Prog directive in setting up the server.

By organizing the Prog commands like this, we avoid the situation where we are recreating the same Prog steps multiple times every time we need to provision and set up a basic server.

Decide on a naming convention

Using the same examples as above where we need to reference a server IP, port, username, and password within the main Prog and external Progs

Defining default values

It is very common that your Prog command scripts require a set of “default values”. This helps make it easier for your users and minimize the need for users to have to manually input values using the Ask User Input directive.

Use labels

When designing Prog commands, it is recommended that you label each step. Labelling makes things easier to understand later on what each step does, as well as provide a means to quickly identify where issues may arise as labels are shown when Progs are run.