|
From: | Asheesh Laroia |
Subject: | Re: [Userops] Antonio Terceiro's DebConf talk on packaging free software web applications |
Date: | Tue, 25 Aug 2015 12:18:43 -0700 |
So I think I'm -1 on environment variables, and here's why:
- I agree that environment variables provide a sense of coherence
that's "already here", and so that's tempting. But!
- Environment variables are the POSIX global variable system, and I've
had enough troubles fighting global variables the last few years.
I'd like to not invent new systems to fight them all over again.
- Environment variables are an extremely lossy format, being
strings-only.
- The primary goal is a shared state, but what if deploying multiple
applications? This seems to move back towards the problem of
assuming packages are going to roll out one apache config for a user,
and that's all the user needs is one application.
Okay, you might say, we'll just swap out the environment variables
every time we launch an application! This is still tricky when it
comes to, say, an application that is dependent upon connections to
two separate postgres daemons, which you might imagine are now
expecting environment-based configuration.
- It seems to me that a good system is a combination of reflection
upward towards a user interface for configuration, and then back down
again *through composition*.
(Notice, I do not expect end-users to be doing this composition
themselves, it's important to notice the reflection upwards as well
as the passing downwards to determine the user's system.)
It's unfortunate that we have so many configuration format systems
(which puts some towards system recipe authors), however, the
benefits of having an application built to run based off of the
composed configuration as made by very high level user decisions is
much stronger, and in this case at least you may consider both
configuration files and program arguments to be the equivalent to a
function invocation. It's easy to invoke a function again and again
with different arguments; in a system where those functions read from
global variables, things become much trickier.
- Patching all applications to become environment variable aware and
eschew their configuration formats is asking a lot of applications,
while introducing many new problems.
So... if a new system were to come about that was environment variable
based, I have to feel like I'd be pretty unenthused aobut it.
[Prev in Thread] | Current Thread | [Next in Thread] |