Environment variables are useful in their own situations. For instance, OpenShift signals the open IP and Port number as environment variables. Which is useful when you have a program with an unknown set of command-line parameters. Either that or when you only need a subset of the available command-line parameters.